From 9276beb50df23ab4781e3f6d3992e937dfb0a204 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 18 Jan 2023 19:28:23 +0100 Subject: [PATCH] refactor(core): set node initialized after applying dimensions change Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- packages/core/src/store/actions.ts | 2 -- packages/core/src/utils/changes.ts | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/store/actions.ts b/packages/core/src/store/actions.ts index 046f2d78..a0be0c9d 100644 --- a/packages/core/src/store/actions.ts +++ b/packages/core/src/store/actions.ts @@ -139,8 +139,6 @@ export function useActions(state: State, getters: ComputedGetters): Actions { node.handleBounds.source = getHandleBounds('.source', update.nodeElement, zoom) node.handleBounds.target = getHandleBounds('.target', update.nodeElement, zoom) - if (!node.initialized) node.initialized = true - res.push({ id: node.id, type: 'dimensions', diff --git a/packages/core/src/utils/changes.ts b/packages/core/src/utils/changes.ts index 4bbc7f08..b474885e 100644 --- a/packages/core/src/utils/changes.ts +++ b/packages/core/src/utils/changes.ts @@ -169,6 +169,8 @@ export const applyChanges = < handleParentExpand(element, parent) } } + + if (!element.initialized) element.initialized = true } break }