diff options
| author | Henry Jameson <me@hjkos.com> | 2022-08-24 22:37:07 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-08-24 22:37:07 +0300 |
| commit | 09a4d963d4dd336c0d46f5abed0d9a47bbd0de6e (patch) | |
| tree | ace6adfe441a83d6199f36e8c2fbde15813b4b9e /src/components/notifications | |
| parent | 986c4537021842e9b21c89c0ffb84033169cafe6 (diff) | |
fix notifications
Diffstat (limited to 'src/components/notifications')
| -rw-r--r-- | src/components/notifications/notifications.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 058d2669..2682912a 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -98,9 +98,13 @@ const Notifications = { }, mounted () { this.scrollerRef = this.$refs.root.closest('.column.-scrollable') + if (!this.scrollerRef) { + this.scrollerRef = this.$refs.root.closest('.mobile-notifications') + } this.scrollerRef.addEventListener('scroll', this.updateScrollPosition) }, unmounted () { + if (!this.scrollerRef) return this.scrollerRef.removeEventListener('scroll', this.updateScrollPosition) }, watch: { @@ -112,6 +116,16 @@ const Notifications = { FaviconService.clearFaviconBadge() this.$store.dispatch('setPageTitle', '') } + }, + teleportTarget () { + // handle scroller change + this.scrollerRef.removeEventListener('scroll', this.updateScrollPosition) + this.scrollerRef = this.$refs.root.closest('.column.-scrollable') + if (!this.scrollerRef) { + this.scrollerRef = this.$refs.root.closest('.mobile-notifications') + } + this.scrollerRef.addEventListener('scroll', this.updateScrollPosition) + this.updateScrollPosition() } }, methods: { |
