1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-05 08:29:57 +00:00
elk/pages/@[account]/index.vue

31 lines
899 B
Vue
Raw Normal View History

2022-11-13 16:05:32 +00:00
<script setup lang="ts">
const props = defineProps<{
modelValue?: boolean
}>()
const params = useRoute().params
2022-11-24 05:47:14 +00:00
const accountName = $computed(() => params.account as string)
2022-11-24 05:47:14 +00:00
const account = await fetchAccountByName(accountName)
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')
2022-11-24 06:18:05 +00:00
const paginator1 = masto.accounts.getStatusesIterable(account.id, { excludeReplies: true })
const paginator2 = masto.accounts.getStatusesIterable(account.id, { excludeReplies: false })
const paginator = $computed(() => {
2022-11-24 06:18:05 +00:00
return tab === 'Posts' ? paginator1 : paginator2
})
2022-11-13 16:05:32 +00:00
</script>
<template>
2022-11-24 06:18:05 +00:00
<div>
2022-11-23 17:16:10 +00:00
<CommonTabs v-model="tab" :options="tabNames" />
2022-11-24 06:18:05 +00:00
<KeepAlive>
<TimelinePaginator :key="tab" :paginator="paginator" />
</KeepAlive>
</div>
2022-11-13 16:05:32 +00:00
</template>