fix(pages): redirect to homepage if user isn't found from api

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2024-11-11 17:31:05 -05:00
parent 40bb98eb1d
commit 09762a7efb
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

View File

@ -10,7 +10,7 @@
const { data: ses } = useAuth();
const { data: userInfo } = await useApiFetch<IUser | null>(`/user/${rtr.params.id}`);
if (userInfo === null) {
if (userInfo.value === null) {
navigateTo("/");
}
const activeKey = ref("main");
@ -49,9 +49,9 @@
</div>
<div v-else>
<span>
{{ format(uLastVisit, "MM/dd/yyyy @ hh:mm:ss a") }}
{{ format(userInfo.lastVisit, "MM/dd/yyyy @ hh:mm:ss a") }}
</span>
<span style="margin-left: 0.6em"> ({{ formatDistanceToNow(uLastVisit, { addSuffix: true }) }}) </span>
<span style="margin-left: 0.6em"> ({{ formatDistanceToNow(userInfo.lastVisit, { addSuffix: true }) }}) </span>
</div>
</a-descriptions-item>
<a-descriptions-item label="Website">