feat(status): try to open in original site

This commit is contained in:
三咲智子 2022-11-29 04:02:44 +08:00
parent 259e11c097
commit 569655095d
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
2 changed files with 31 additions and 3 deletions

View file

@ -0,0 +1,30 @@
<script setup lang="ts">
const { account, status } = defineProps<{
account: string
status: string
}>()
const originalUrl = computed(() => {
const [handle, _server] = account.split('@')
const server = _server || currentUser.value?.server
if (!server)
return null
return `https://${server}/@${handle}/${status}`
})
</script>
<template>
<CommonNotFound>
<div flex="~ col center gap2">
<div>Status not found</div>
<NuxtLink v-if="originalUrl" :to="originalUrl" target="_blank">
<button btn-solid flex="~ center gap-2" px2 py1>
<div i-ri:arrow-right-up-line />
Try original site
</button>
</NuxtLink>
</div>
</CommonNotFound>
</template>

View file

@ -74,9 +74,7 @@ onReactivated(() => {
<div border="t base" :style="{ height: `${bottomSpace}px` }" />
</div>
<CommonNotFound v-else>
Status not found
</CommonNotFound>
<StatusNotFound v-else :account="$route.params.account" :status="id" />
</template>
<StatusCardSkeleton v-else border="b base" py-3 />