Skip to content

Commit b5dd3d0

Browse files
committed
Added: redirect to home when no project exists
1 parent 7b10341 commit b5dd3d0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pages/projects/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ const projectsPending = computed(() =>
9595
projectsPostsLatestQuery.status.value === 'pending'
9696
|| projectsPostsCreatedQuery.status.value === 'pending')
9797
98+
watch(projectsPending, (pending) => {
99+
if (!pending && projectsLatestData.value.length === 0)
100+
navigateTo('/', { replace: true, redirectCode: 404 })
101+
}, { immediate: true })
102+
98103
useSeoMetaHelper({
99104
title: 'Blog',
100105
description: 'Helltraitor blog',

0 commit comments

Comments
 (0)