Skip to content

Commit

Permalink
refactoring link target refreshing in landing showcase diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
K0369 committed Oct 22, 2023
1 parent ff0fd5a commit 95a9734
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions site/Site/Components/Landing/LandingShowcaseDiagram.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ private void OnLinkAdded(BaseLinkModel link)

private void OnLinKTargetChanged(BaseLinkModel link, Anchor? oldTarget, Anchor? newTarget)
{
if (link.IsAttached && newTarget is not null)
// only refresh on the first time the link is attached
if (oldTarget is PositionAnchor
&& newTarget.Model is PortModel targetModel
&& link.IsAttached)
{
(newTarget.Model as PortModel)!.Parent.Refresh();
targetModel.Parent.Refresh();
}
}

Expand Down

0 comments on commit 95a9734

Please sign in to comment.