Skip to content

Commit

Permalink
fix: reset page data on 404 (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Feb 22, 2022
1 parent 7cf7011 commit 28eaa3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/client/app/router.ts
Expand Up @@ -123,6 +123,15 @@ export function createRouter(
latestPendingPath = null
route.path = pendingPath
route.component = fallbackComponent ? markRaw(fallbackComponent) : null
// reset page data
route.data = {
relativePath: '',
title: '404',
description: 'Not Found',
headers: [],
frontmatter: {},
lastUpdated: 0
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/theme-default/components/LastUpdated.vue
Expand Up @@ -7,7 +7,7 @@ const { theme, page } = useData()
const hasLastUpdated = computed(() => {
const lu = theme.value.lastUpdated
return lu !== undefined && lu !== false
return lu !== undefined && lu !== false && page.value.lastUpdated !== 0
})
const prefix = computed(() => {
Expand Down

0 comments on commit 28eaa3b

Please sign in to comment.