From 1ee0ec68c52fb7326ac22ad846aee5dcebebab46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Wed, 5 Jul 2023 14:33:41 +0800 Subject: [PATCH] feat: show hint on empty timeline --- components/common/CommonPaginator.vue | 4 +-- components/timeline/TimelinePaginator.vue | 30 ++++++++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/components/common/CommonPaginator.vue b/components/common/CommonPaginator.vue index 59387338..00c2bbde 100644 --- a/components/common/CommonPaginator.vue +++ b/components/common/CommonPaginator.vue @@ -40,7 +40,7 @@ defineSlots<{ update: () => void }) => void loading: (props: {}) => void - done: (props: {}) => void + done: (props: { items: U[] }) => void }>() const { t } = useI18n() @@ -110,7 +110,7 @@ defineExpose({ createEntry, removeEntry, updateEntry }) - +
{{ t(typeof endMessage === 'string' ? endMessage : 'common.end_of_list') }}
diff --git a/components/timeline/TimelinePaginator.vue b/components/timeline/TimelinePaginator.vue index 9d049165..ec8a7e1b 100644 --- a/components/timeline/TimelinePaginator.vue +++ b/components/timeline/TimelinePaginator.vue @@ -4,7 +4,7 @@ import { DynamicScrollerItem } from 'vue-virtual-scroller' import 'vue-virtual-scroller/dist/vue-virtual-scroller.css' import type { Paginator, WsEvents, mastodon } from 'masto' -const { paginator, stream, account, buffer = 10, endMessage } = defineProps<{ +const { paginator, stream, account, buffer = 10, endMessage = true } = defineProps<{ paginator: Paginator stream?: Promise context?: mastodon.v2.FilterContext @@ -39,17 +39,23 @@ const showOriginSite = $computed(() => -