mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-25 10:46:17 +03:00
fix: user 404
This commit is contained in:
parent
3dddf6d5f7
commit
3c550b832b
2 changed files with 5 additions and 21 deletions
|
@ -1,20 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{
|
|
||||||
modelValue?: boolean
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const params = useRoute().params
|
const params = useRoute().params
|
||||||
const accountName = $computed(() => params.account as string)
|
const accountName = $computed(() => params.account as string)
|
||||||
|
|
||||||
const account = await fetchAccountByName(accountName)
|
const account = await fetchAccountByName(accountName).catch(() => null)
|
||||||
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)
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -25,7 +13,7 @@ const paginator = $computed(() => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<CommonNotFound v-else>
|
<CommonNotFound v-else>
|
||||||
Account @{{ params.user }} not found
|
Account @{{ accountName }} not found
|
||||||
</CommonNotFound>
|
</CommonNotFound>
|
||||||
</MainContent>
|
</MainContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{
|
|
||||||
modelValue?: boolean
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const params = useRoute().params
|
const params = useRoute().params
|
||||||
const accountName = $computed(() => params.account as string)
|
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.
|
// 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 tab = $ref('Posts')
|
||||||
|
|
||||||
const paginator1 = masto.accounts.getStatusesIterable(account.id, { excludeReplies: true })
|
const paginatorPosts = masto.accounts.getStatusesIterable(account.id, { excludeReplies: true })
|
||||||
const paginator2 = masto.accounts.getStatusesIterable(account.id, { excludeReplies: false })
|
const paginatorPostsWithReply = masto.accounts.getStatusesIterable(account.id, { excludeReplies: false })
|
||||||
|
|
||||||
const paginator = $computed(() => {
|
const paginator = $computed(() => {
|
||||||
return tab === 'Posts' ? paginator1 : paginator2
|
return tab === 'Posts' ? paginatorPosts : paginatorPostsWithReply
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue