From 1ec65cd143a2b5f27c8def6de02d02a222577d04 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 6 Dec 2023 11:29:14 +0100 Subject: [PATCH] fix loading address paths --- src/Update/Graph.elm | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Update/Graph.elm b/src/Update/Graph.elm index 2d2b906f..37d083a3 100644 --- a/src/Update/Graph.elm +++ b/src/Update/Graph.elm @@ -109,7 +109,32 @@ addAddress plugins uc { address, entity, incoming, outgoing, anchor } model = model added = - Layer.addAddress plugins uc newModel.config.colors address newModel.layers + -- grab the added entities ... + eff + |> List.foldl + (\ef entityIds -> + case ef of + InternalGraphAddedEntitiesEffect ids -> + Set.union entityIds ids + + _ -> + entityIds + ) + Set.empty + -- ... and add the address to them + |> Set.foldl + (\entityId added_ -> + Layer.addAddressAtEntity plugins + uc + entityId + address + added_ + ) + { colors = newModel.config.colors + , layers = newModel.layers + , new = Set.empty + , repositioned = Set.empty + } newModel_ = { newModel @@ -323,7 +348,7 @@ updateByMsg plugins uc msg model = n model InternalGraphSelectedAddress id -> - loadNextAddress plugins uc model id + n model -- handled upstream BrowserGotBrowserElement result ->