Skip to content

Commit

Permalink
fix: try to read pageContext.pinia only if needed (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Sep 12, 2024
1 parent b9deb70 commit d97fc6f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vike-vue-pinia/integration/onBeforeRenderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ const onBeforeRenderClient: OnBeforeRenderClientSync = (pageContext): ReturnType

type PageContext = Parameters<typeof onBeforeRenderClient>[0]
function hydratePinia(pageContext: PageContext) {
const { pinia, fromHtmlRenderer, isHydration } = pageContext

if (!isHydration) {
if (!pageContext.isHydration) {
return
}
const { pinia, fromHtmlRenderer } = pageContext

const { piniaInitialState } = fromHtmlRenderer

Expand Down

0 comments on commit d97fc6f

Please sign in to comment.