fix(core): ref access when passing default edge options

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-02 12:24:08 +01:00
committed by Braks
parent 764a440296
commit cae9562481
2 changed files with 2 additions and 2 deletions

View File

@@ -182,7 +182,7 @@ export default function useHandle({
)
if (isValid) {
if (!onEdgeUpdate) emits.connect({ ...defaultEdgeOptions, ...connection })
if (!onEdgeUpdate) emits.connect({ ...(defaultEdgeOptions?.value || {}), ...connection })
else onEdgeUpdate(connection)
}
}

View File

@@ -568,7 +568,7 @@ export function useActions(state: State, getters: ComputedGetters): Actions {
if (!state.initialized) state.initialized = true
}
const toObject = () => {
const toObject: Actions['toObject'] = () => {
// we have to stringify/parse so objects containing refs (like nodes and edges) can potentially be saved in a storage
return JSON.parse(
JSON.stringify({