mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-28 05:28:05 +03:00
feat(status): try to open in original site
This commit is contained in:
parent
259e11c097
commit
569655095d
2 changed files with 31 additions and 3 deletions
30
components/status/StatusNotFound.vue
Normal file
30
components/status/StatusNotFound.vue
Normal 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>
|
|
@ -74,9 +74,7 @@ onReactivated(() => {
|
||||||
<div border="t base" :style="{ height: `${bottomSpace}px` }" />
|
<div border="t base" :style="{ height: `${bottomSpace}px` }" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CommonNotFound v-else>
|
<StatusNotFound v-else :account="$route.params.account" :status="id" />
|
||||||
Status not found
|
|
||||||
</CommonNotFound>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<StatusCardSkeleton v-else border="b base" py-3 />
|
<StatusCardSkeleton v-else border="b base" py-3 />
|
||||||
|
|
Loading…
Reference in a new issue