chore(core): cleanup useVueFlow

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-05 23:51:28 +01:00
parent 64e9dc3c1e
commit 1448543993
+8 -4
View File
@@ -137,11 +137,15 @@ export default (options?: FlowProps): VueFlowStore => {
if (isParentScope) { if (isParentScope) {
// dispose of state values and storage entry // dispose of state values and storage entry
tryOnScopeDispose(() => { tryOnScopeDispose(() => {
if (storage.get(vueFlow!.id)) { if (vueFlow) {
vueFlow!.$destroy() const storedInstance = storage.get(vueFlow.id)
}
vueFlow = null if (storedInstance) {
storedInstance.$destroy()
} else {
warn(`No store instance found for id ${vueFlow.id} in storage.`)
}
}
}) })
} }
} }