fix(vue-flow): unregister apply handlers when applyDefault is false

This commit is contained in:
bcakmakoglu
2022-06-01 19:10:30 +02:00
committed by Braks
parent 42ea2de513
commit 30efd62082
@@ -156,6 +156,9 @@ export default (models: ToRefs<Pick<FlowProps, 'nodes' | 'edges' | 'modelValue'>
if (store.applyDefault.value) {
store.onNodesChange(store.applyNodeChanges)
store.onEdgesChange(store.applyEdgeChanges)
} else {
store.hooks.value.nodesChange.off(store.applyNodeChanges)
store.hooks.value.edgesChange.off(store.applyEdgeChanges)
}
},
{ immediate: true },