fix(nuxt): don't check page/layout usage when redirecting (#25628)

This commit is contained in:
Daniel Roe 2024-02-05 11:57:49 +00:00 committed by GitHub
parent e33cec9580
commit 9dfc0c2c31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ export default defineNuxtPlugin({
}
}
if (import.meta.server) {
nuxtApp.hook('app:rendered', () => { nextTick(checkIfLayoutUsed) })
nuxtApp.hook('app:rendered', ({ renderResult }) => { renderResult?.html && nextTick(checkIfLayoutUsed) })
} else {
onNuxtReady(checkIfLayoutUsed)
}

View File

@ -19,7 +19,7 @@ export default defineNuxtPlugin({
}
if (import.meta.server) {
nuxtApp.hook('app:rendered', () => { nextTick(checkIfPageUnused) })
nuxtApp.hook('app:rendered', ({ renderResult }) => { renderResult?.html && nextTick(checkIfPageUnused) })
} else {
onNuxtReady(checkIfPageUnused)
}