aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-16 09:56:24 +0200
committerChocobozzz <me@florianbigard.com>2020-06-16 11:26:46 +0200
commit64e0f8cf12c804a7a2fa582fd954f686cea9a45b (patch)
treee76dd7980665c1ac814ed4acd4fe9ce3a3e11974 /client/src/app/+my-account
parentc7763eddd14ee6a4a448d5187f46f79b22047d20 (diff)
downloadPeerTube-64e0f8cf12c804a7a2fa582fd954f686cea9a45b.tar.gz
PeerTube-64e0f8cf12c804a7a2fa582fd954f686cea9a45b.tar.zst
PeerTube-64e0f8cf12c804a7a2fa582fd954f686cea9a45b.zip
Fix scrolling with hash in url
Diffstat (limited to 'client/src/app/+my-account')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.ts8
1 files changed, 7 insertions, 1 deletions
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 {
23 userVideoQuotaUsedDaily = 0 23 userVideoQuotaUsedDaily = 0
24 userVideoQuotaDailyPercentage = 15 24 userVideoQuotaDailyPercentage = 15
25 25
26 private lastScrollHash: string
27
26 constructor ( 28 constructor (
27 private viewportScroller: ViewportScroller, 29 private viewportScroller: ViewportScroller,
28 private userService: UserService, 30 private userService: UserService,
@@ -64,7 +66,11 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked {
64 } 66 }
65 67
66 ngAfterViewChecked () { 68 ngAfterViewChecked () {
67 if (window.location.hash) this.viewportScroller.scrollToAnchor(window.location.hash.replace('#', '')) 69 if (window.location.hash && window.location.hash !== this.lastScrollHash) {
70 this.viewportScroller.scrollToAnchor(window.location.hash.replace('#', ''))
71
72 this.lastScrollHash = window.location.hash
73 }
68 } 74 }
69 75
70 onAvatarChange (formData: FormData) { 76 onAvatarChange (formData: FormData) {