]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix: set initial state in prod
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 5 Aug 2021 15:28:31 +0000 (17:28 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 5 Aug 2021 15:28:31 +0000 (17:28 +0200)
fix #598

src/store.ts

index f2d4dd518a8109d5a30fbe931b9c5891844aabbf..2f0b6391061238aa42aae794f0f90fced8daddcf 100644 (file)
@@ -204,7 +204,7 @@ function createSetupStore<
   let debuggerEvents: DebuggerEvent[] | DebuggerEvent
   const initialState = pinia.state.value[$id] as UnwrapRef<S> | undefined
 
-  if (!initialState && __DEV__ && !hot) {
+  if (!initialState && (!__DEV__ || !hot)) {
     if (isVue2) {
       set(pinia.state.value, $id, {})
     } else {