Canvas: Remove deleted connections from source (#65321)

This commit is contained in:
Adela Almasan
2023-03-27 19:51:56 +03:00
committed by GitHub
parent 1387fec51d
commit 21ede347cb
2 changed files with 11 additions and 0 deletions
@@ -6,6 +6,7 @@ import { notFoundItem } from 'app/features/canvas/elements/notFound';
import { DimensionContext } from 'app/features/dimensions';
import { LayerActionID } from 'app/plugins/panel/canvas/types';
import { updateConnectionsForSource } from '../../../plugins/panel/canvas/utils';
import { CanvasElementItem } from '../element';
import { HorizontalConstraint, Placement, VerticalConstraint } from '../types';
@@ -114,6 +115,7 @@ export class FrameState extends ElementState {
switch (action) {
case LayerActionID.Delete:
this.elements = this.elements.filter((e) => e !== element);
updateConnectionsForSource(element, this.scene);
this.scene.byName.delete(element.options.name);
this.scene.save();
this.reinitializeMoveable();