Skip to content

Commit c4b4826

Browse files
committed
fix(core): prevent undefined being passed to update node internals
Signed-off-by: braks <[email protected]>
1 parent cd9b70f commit c4b4826

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/src/store/actions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export function useActions(state: State, getters: ComputedGetters): Actions {
2828
const nodeIds = $computed(() => state.nodes.map((n) => n.id))
2929
const edgeIds = $computed(() => state.edges.map((e) => e.id))
3030

31-
const updateNodeInternals: Actions['updateNodeInternals'] = (ids) => state.hooks.updateNodeInternals.trigger(ids ?? nodeIds)
31+
const updateNodeInternals: Actions['updateNodeInternals'] = (ids) => {
32+
const updateIds = ids ?? nodeIds ?? []
33+
34+
state.hooks.updateNodeInternals.trigger(updateIds)
35+
}
3236

3337
const findNode: Actions['findNode'] = (id) => {
3438
if (state.nodes && !nodeIds.length) return state.nodes.find((node) => node.id === id)

0 commit comments

Comments
 (0)