Skip to content

Commit

Permalink
move the new code outside of the try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
usk94 committed May 20, 2024
1 parent 74d05b1 commit e0a6165
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions vike/client/client-routing-runtime/renderPageClientSide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,20 @@ async function renderPageClientSide(renderArgs: RenderArgs): Promise<void> {
await renderPageView(pageContext)
} else {
let res: Awaited<ReturnType<typeof getPageContextFromHooks_isNotHydration>> | PrefetchedPageContext
try {
const prefetchedPageContext = globalObjectForPrefetchedPageContext?.prefetchedPageContext
if (
prefetchedPageContext?.pageContextFromHooks &&
'_pageId' in prefetchedPageContext.pageContextFromHooks &&
prefetchedPageContext.pageContextFromHooks._pageId === pageContext._pageId
) {
res = prefetchedPageContext
} else {
const prefetchedPageContext = globalObjectForPrefetchedPageContext?.prefetchedPageContext
if (
prefetchedPageContext?.pageContextFromHooks &&
'_pageId' in prefetchedPageContext.pageContextFromHooks &&
prefetchedPageContext.pageContextFromHooks._pageId === pageContext._pageId
) {
res = prefetchedPageContext
} else {
try {
res = await getPageContextFromHooks_isNotHydration(pageContext, false)
} catch (err) {
await onError(err)
return
}
} catch (err) {
await onError(err)
return
}
if (isRenderOutdated()) return
if ('is404ServerSideRouted' in res) return
Expand Down

0 comments on commit e0a6165

Please sign in to comment.