From 58f5c2568ce38f2ef30aec7bb63bd414dd58554a Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Sun, 28 Nov 2021 12:14:19 +0100 Subject: [PATCH] update(store): try to get active pinia before using new one Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- src/store/stateStore.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/stateStore.ts b/src/store/stateStore.ts index 7ec031d9..97f8f0c3 100644 --- a/src/store/stateStore.ts +++ b/src/store/stateStore.ts @@ -1,5 +1,5 @@ import microDiff from 'microdiff' -import { setActivePinia, createPinia, defineStore, StoreDefinition, acceptHMRUpdate } from 'pinia' +import { setActivePinia, createPinia, defineStore, StoreDefinition, acceptHMRUpdate, getActivePinia } from 'pinia' import { FlowState, FlowActions, Elements, FlowGetters, GraphNode, GraphEdge } from '~/types' import { getConnectedEdges, @@ -17,7 +17,7 @@ import { const pinia = createPinia() export default (id: string, preloadedState: FlowState) => { - setActivePinia(pinia) + setActivePinia(getActivePinia() ?? pinia) const store: StoreDefinition = defineStore({ id: id ?? 'vue-flow',