fix: user 404
parent
3dddf6d5f7
commit
3c550b832b
|
@ -1,20 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
modelValue?: boolean
|
||||
}>()
|
||||
|
||||
const params = useRoute().params
|
||||
const accountName = $computed(() => params.account as string)
|
||||
|
||||
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')
|
||||
|
||||
const paginator = $computed(() => {
|
||||
return masto.accounts.getStatusesIterable(account.id, { excludeReplies: tab === 'Posts' } as any)
|
||||
})
|
||||
const account = await fetchAccountByName(accountName).catch(() => null)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -25,7 +13,7 @@ const paginator = $computed(() => {
|
|||
</template>
|
||||
|
||||
<CommonNotFound v-else>
|
||||
Account @{{ params.user }} not found
|
||||
Account @{{ accountName }} not found
|
||||
</CommonNotFound>
|
||||
</MainContent>
|
||||
</template>
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
modelValue?: boolean
|
||||
}>()
|
||||
|
||||
const params = useRoute().params
|
||||
const accountName = $computed(() => params.account as string)
|
||||
|
||||
|
@ -12,11 +8,11 @@ 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 paginator1 = masto.accounts.getStatusesIterable(account.id, { excludeReplies: true })
|
||||
const paginator2 = masto.accounts.getStatusesIterable(account.id, { excludeReplies: false })
|
||||
const paginatorPosts = masto.accounts.getStatusesIterable(account.id, { excludeReplies: true })
|
||||
const paginatorPostsWithReply = masto.accounts.getStatusesIterable(account.id, { excludeReplies: false })
|
||||
|
||||
const paginator = $computed(() => {
|
||||
return tab === 'Posts' ? paginator1 : paginator2
|
||||
return tab === 'Posts' ? paginatorPosts : paginatorPostsWithReply
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue