serverConfig: ServerConfig
+ private lastScrollHash: string
+
constructor (
private viewportScroller: ViewportScroller,
private route: ActivatedRoute,
}
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
+ }
}
openContactModal () {
})
export class AboutPeertubeComponent implements AfterViewChecked {
+ private lastScrollHash: string
+
constructor (
private viewportScroller: ViewportScroller
) {}
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
+ }
}
}
userVideoQuotaUsedDaily = 0
userVideoQuotaDailyPercentage = 15
+ private lastScrollHash: string
+
constructor (
private viewportScroller: ViewportScroller,
private userService: UserService,
}
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) {
const scrollEvent = eventsObs.pipe(filter((e: Event): e is Scroll => e instanceof Scroll))
scrollEvent.subscribe(e => {
+ console.log(e)
if (e.position) {
return this.viewportScroller.scrollToPosition(e.position)
}