diff --git a/components/common/CommonTabs.vue b/components/common/CommonTabs.vue new file mode 100644 index 00000000..c5ab6c6d --- /dev/null +++ b/components/common/CommonTabs.vue @@ -0,0 +1,21 @@ + + + diff --git a/pages/@[user]/index.vue b/pages/@[user]/index.vue index dbde0b47..466fc416 100644 --- a/pages/@[user]/index.vue +++ b/pages/@[user]/index.vue @@ -7,12 +7,23 @@ const params = useRoute().params const user = $computed(() => params.user as string) const masto = await useMasto() const { data: account } = await useAsyncData(`${user}:info`, () => masto.accounts.lookup({ acct: user })) -const paginator = masto.accounts.getStatusesIterable(account.value!.id!, {}) + +const tabNames = ['Posts', 'Posts and replies'] as const + +// Don't use local storage because it is better to default to Posts every time you visit a user's profile. +const tab = $ref('Posts') + +const paginator = $computed(() => { + // bug in Masto.js, it should convert `excludeReplies` to `exclude_replies` + // https://github.com/neet/masto.js/issues/689 + return masto.accounts.getStatusesIterable(account.value!.id!, { exclude_replies: tab === 'Posts' } as any) +}) diff --git a/pages/notifications.vue b/pages/notifications.vue index 49260327..e4062d4d 100644 --- a/pages/notifications.vue +++ b/pages/notifications.vue @@ -1,16 +1,15 @@ @@ -23,13 +22,7 @@ const paginator = $computed(() => {
-
- -
+