From d97fc6fac4984c95d922248ec660ae2b0226cbfe Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Thu, 12 Sep 2024 14:54:20 +0200 Subject: [PATCH] fix: try to read pageContext.pinia only if needed (#193) --- packages/vike-vue-pinia/integration/onBeforeRenderClient.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts b/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts index 8c19dc8f..1be3feee 100644 --- a/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts +++ b/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts @@ -8,11 +8,10 @@ const onBeforeRenderClient: OnBeforeRenderClientSync = (pageContext): ReturnType type PageContext = Parameters[0] function hydratePinia(pageContext: PageContext) { - const { pinia, fromHtmlRenderer, isHydration } = pageContext - - if (!isHydration) { + if (!pageContext.isHydration) { return } + const { pinia, fromHtmlRenderer } = pageContext const { piniaInitialState } = fromHtmlRenderer