From 94ad0bea0593a8f80ebfc9b9368704757c21c9c7 Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Thu, 12 Sep 2024 14:54:27 +0200 Subject: [PATCH] minor refactor --- packages/vike-vue-pinia/integration/onBeforeRenderClient.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts b/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts index 1be3feee..00b577c6 100644 --- a/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts +++ b/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts @@ -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 }