From 59dda09cd479b14d8ccff843296b048b651784f3 Mon Sep 17 00:00:00 2001 From: patak <583075+patak-dev@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:59:24 +0200 Subject: [PATCH] fix: notifications in update timeline (#2740) --- components/common/CommonPaginator.vue | 4 +++- components/notification/NotificationPaginator.vue | 1 + composables/paginator.ts | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/common/CommonPaginator.vue b/components/common/CommonPaginator.vue index 46276eab..e370dbfa 100644 --- a/components/common/CommonPaginator.vue +++ b/components/common/CommonPaginator.vue @@ -8,6 +8,7 @@ import type { UnwrapRef } from 'vue' const { paginator, stream, + eventType, keyProp = 'id', virtualScroller = false, preprocess, @@ -17,6 +18,7 @@ const { keyProp?: keyof T virtualScroller?: boolean stream?: mastodon.streaming.Subscription + eventType?: 'update' | 'notification' preprocess?: (items: (U | T)[]) => U[] endMessage?: boolean | string }>() @@ -44,7 +46,7 @@ defineSlots<{ const { t } = useI18n() const nuxtApp = useNuxtApp() -const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, toRef(() => stream), preprocess) +const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, toRef(() => stream), eventType, preprocess) nuxtApp.hook('elk-logo:click', () => { update() diff --git a/components/notification/NotificationPaginator.vue b/components/notification/NotificationPaginator.vue index 0f390c37..7f08049b 100644 --- a/components/notification/NotificationPaginator.vue +++ b/components/notification/NotificationPaginator.vue @@ -171,6 +171,7 @@ const { formatNumber } = useHumanReadableNumber() :paginator="paginator" :preprocess="preprocess" :stream="stream" + eventType="notification" :virtualScroller="virtualScroller" >