From b6f0bd356a5dbc3addc2ee06bb3a4f7e1ec20548 Mon Sep 17 00:00:00 2001 From: Jacob Hands Date: Wed, 28 Dec 2022 15:43:46 -0600 Subject: [PATCH] fix: Streams slowing down page loads or not loading at all (#620) --- components/common/CommonPaginator.vue | 2 +- .../notification/NotificationPaginator.vue | 2 +- components/timeline/TimelineHome.vue | 4 +- components/timeline/TimelineMentions.vue | 2 +- components/timeline/TimelineNotifications.vue | 2 +- components/timeline/TimelinePaginator.vue | 2 +- components/timeline/TimelinePublic.vue | 11 ++++ components/timeline/TimelinePublicLocal.vue | 11 ++++ composables/paginator.ts | 54 ++++++++++--------- pages/[[server]]/public/index.vue | 8 +-- pages/[[server]]/public/local.vue | 7 +-- pages/[[server]]/tags/[tag].vue | 4 +- 12 files changed, 62 insertions(+), 47 deletions(-) create mode 100644 components/timeline/TimelinePublic.vue create mode 100644 components/timeline/TimelinePublicLocal.vue diff --git a/components/common/CommonPaginator.vue b/components/common/CommonPaginator.vue index 11cd3f9b..3f24c0bf 100644 --- a/components/common/CommonPaginator.vue +++ b/components/common/CommonPaginator.vue @@ -15,7 +15,7 @@ const { paginator: Paginator keyProp?: string virtualScroller?: boolean - stream?: WsEvents + stream?: Promise eventType?: 'notification' | 'update' preprocess?: (items: any[]) => any[] }>() diff --git a/components/notification/NotificationPaginator.vue b/components/notification/NotificationPaginator.vue index 6c08b264..d6dd98c7 100644 --- a/components/notification/NotificationPaginator.vue +++ b/components/notification/NotificationPaginator.vue @@ -4,7 +4,7 @@ import type { GroupedAccountLike, NotificationSlot } from '~/types' const { paginator, stream } = defineProps<{ paginator: Paginator - stream?: WsEvents + stream?: Promise }>() const groupCapacity = Number.MAX_VALUE // No limit diff --git a/components/timeline/TimelineHome.vue b/components/timeline/TimelineHome.vue index 10d5c26a..9581e452 100644 --- a/components/timeline/TimelineHome.vue +++ b/components/timeline/TimelineHome.vue @@ -1,8 +1,8 @@