From 585b9e022974cddb559bcbeb967fd344ff36581a Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 2 Dec 2022 02:21:10 +0000 Subject: [PATCH] feat: show and stream new notifications (#282) Co-authored-by: Anthony Fu --- components/common/CommonPaginator.vue | 5 ++- components/nav/NavSide.vue | 15 ++++++- .../notification/NotificationPaginator.vue | 14 +++++-- composables/paginator.ts | 4 +- composables/users.ts | 39 ++++++++++++++++++- pages/notifications.vue | 7 +++- 6 files changed, 74 insertions(+), 10 deletions(-) diff --git a/components/common/CommonPaginator.vue b/components/common/CommonPaginator.vue index e035b916..ad106717 100644 --- a/components/common/CommonPaginator.vue +++ b/components/common/CommonPaginator.vue @@ -4,11 +4,12 @@ import { DynamicScroller } from 'vue-virtual-scroller' import 'vue-virtual-scroller/dist/vue-virtual-scroller.css' import type { Paginator, WsEvents } from 'masto' -const { paginator, stream, keyProp = 'id', virtualScroller = false } = defineProps<{ +const { paginator, stream, keyProp = 'id', virtualScroller = false, eventType = 'update' } = defineProps<{ paginator: Paginator keyProp?: string virtualScroller?: boolean stream?: WsEvents + eventType?: 'notification' | 'update' }>() defineSlots<{ @@ -23,7 +24,7 @@ defineSlots<{ loading: {} }>() -const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, stream) +const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, stream, eventType)