Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Sep 12, 2024
1 parent d97fc6f commit 94ad0be
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/vike-vue-pinia/integration/onBeforeRenderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ function hydratePinia(pageContext: PageContext) {
if (!pageContext.isHydration) {
return
}
const { pinia, fromHtmlRenderer } = pageContext

const { piniaInitialState } = fromHtmlRenderer

const { pinia, fromHtmlRenderer: { piniaInitialState } } = pageContext
if (!pinia || !piniaInitialState) {
// happens if SSR is off
return
}

// @ts-expect-error TODO: fix type mismatch between Config['fromHtmlRenderer'] set by vike-vue and vike-vue-pinia
pinia.state.value = piniaInitialState
}

0 comments on commit 94ad0be

Please sign in to comment.