X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bmy-account%2Fmy-account-settings%2Fmy-account-settings.component.ts;h=f73f3aa1e09de556fc9812d803dfe0c0df596f6d;hb=64e0f8cf12c804a7a2fa582fd954f686cea9a45b;hp=5f2db985487dc873f0aff6fb824d6a909d708542;hpb=df8914c9a2d6dbb435460b9e252a771cac47880b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts index 5f2db9854..f73f3aa1e 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts @@ -23,6 +23,8 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { userVideoQuotaUsedDaily = 0 userVideoQuotaDailyPercentage = 15 + private lastScrollHash: string + constructor ( private viewportScroller: ViewportScroller, private userService: UserService, @@ -64,7 +66,11 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { } ngAfterViewChecked () { - if (window.location.hash) this.viewportScroller.scrollToAnchor(window.location.hash.replace('#', '')) + if (window.location.hash && window.location.hash !== this.lastScrollHash) { + this.viewportScroller.scrollToAnchor(window.location.hash.replace('#', '')) + + this.lastScrollHash = window.location.hash + } } onAvatarChange (formData: FormData) {