From 93730a7b98749f021083be6b9d72dde26123eda9 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 16 Nov 2021 19:59:44 +0100 Subject: [PATCH] update: count store id gradually up instead of "randomizing" one Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- src/store/useFlowStore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/useFlowStore.ts b/src/store/useFlowStore.ts index 959e3e74..5320f9eb 100644 --- a/src/store/useFlowStore.ts +++ b/src/store/useFlowStore.ts @@ -19,12 +19,13 @@ type NextElements = { nextEdges: Edge[] } const pinia = createPinia() +let id = 0 export default function useFlowStore(preloadedState: FlowState): StoreDefinition { setActivePinia(pinia) return defineStore({ - id: `vue-flow-${Math.floor(Math.random() * 100)}`, + id: `vue-flow-${id++}`, state: () => ({ ...preloadedState, }),