8000 fix(nuxt): don't call `page:loading:end` in cache if already called · nuxt/nuxt@fbbe101 · GitHub
[go: up one dir, main page]

Skip to content

Commit fbbe101

Browse files
committed
fix(nuxt): don't call page:loading:end in cache if already called
1 parent 4eedbca commit fbbe101

File tree

1 file changed

+4
-2
lines changed
  • packages/nuxt/src/pages/runtime

1 file changed

+4
-2
lines changed

packages/nuxt/src/pages/runtime/page.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ export default defineComponent({
142142
const willRenderAnotherChild = hasChildrenRoutes(forkRoute, routeProps.route, routeProps.Component)
143143
if (!nuxtApp.isHydrating && previousPageKey === key && !willRenderAnotherChild) {
144144
nextTick(() => {
145-
pageLoadingEndHookAlreadyCalled = true
146-
nuxtApp.callHook('page:loading:end')
145+
if (!pageLoadingEndHookAlreadyCalled) {
146+
pageLoadingEndHookAlreadyCalled = true
147+
nuxtApp.callHook('page:loading:end')
148+
}
147149
})
148150
}
149151

0 commit comments

Comments
 (0)
0