Skip to content

Commit

Permalink
Fix: sockets need to be re-set after component update
Browse files Browse the repository at this point in the history
  • Loading branch information
jobelenus committed Dec 20, 2024
1 parent 60a3f21 commit 301a35e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/web/src/store/views.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1747,6 +1747,11 @@ export const useViewsStore = (forceChangeSetId?: ChangeSetId) => {
finalGeo.height = node.height;
finalGeo.width = node.width;
view.components[data.component.id] = finalGeo as IRect;
for (const [key, loc] of Object.entries(
setSockets(node, finalGeo),
)) {
view.sockets[key] = loc;
}
} else {
if (!finalGeo.width) finalGeo.width = 500;
if (!finalGeo.height) finalGeo.height = 500;
Expand All @@ -1755,6 +1760,15 @@ export const useViewsStore = (forceChangeSetId?: ChangeSetId) => {
size: finalGeo.width * finalGeo.height,
zIndex: 0,
};
const node = processRawComponent(
data.component,
componentsStore.rawComponentsById,
) as DiagramGroupData;
for (const [key, loc] of Object.entries(
setSockets(node, finalGeo),
)) {
view.sockets[key] = loc;
}
}
});
this.setGroupZIndex();
Expand Down

0 comments on commit 301a35e

Please sign in to comment.