Skip to content

Commit

Permalink
revert: refactor(client): handle page data hmr by checking pageChunk ref
Browse files Browse the repository at this point in the history
It would cause error in webpack hmr
  • Loading branch information
meteorlxy committed Feb 19, 2024
1 parent c645d1a commit bb96427
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client/src/setupGlobalComputed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export const setupGlobalComputed = (
const newPageChunk = { comp: oldPageChunk.comp, data: newPageData }
routes.value[newPageData.path].loader = () =>
Promise.resolve(newPageChunk)
if (newPageData.path === pageChunk.value.data.path) {
if (
newPageData.path ===
router.currentRoute.value.meta._pageChunk?.data.path
) {
pageChunk.value = newPageChunk
}
}
Expand Down

0 comments on commit bb96427

Please sign in to comment.