logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 09a4d963d4dd336c0d46f5abed0d9a47bbd0de6e
parent 986c4537021842e9b21c89c0ffb84033169cafe6
Author: Henry Jameson <me@hjkos.com>
Date:   Wed, 24 Aug 2022 22:37:07 +0300

fix notifications

Diffstat:

Msrc/components/notifications/notifications.js14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git 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: {