From 6fdf6adab38dda2c370046cad3ec62ce08916871 Mon Sep 17 00:00:00 2001 From: pfh59 <109206285+pfh59@users.noreply.github.com> Date: Sun, 24 Nov 2024 22:50:26 +0100 Subject: [PATCH] Refactor selection logic to handle multiple system nodes and links (#319) * Refactor selection logic to handle multiple system nodes and links * Remove unnecessary return statement in Overview component --- src/WHMapper/Pages/Mapper/Map/Overview.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/WHMapper/Pages/Mapper/Map/Overview.cs b/src/WHMapper/Pages/Mapper/Map/Overview.cs index 113b223..9b910ca 100644 --- a/src/WHMapper/Pages/Mapper/Map/Overview.cs +++ b/src/WHMapper/Pages/Mapper/Map/Overview.cs @@ -381,13 +381,22 @@ await InvokeAsync(() => _selectedSystemNodes = selectedModels.OfType().ToList(); _selectedSystemLinks = selectedModels.OfType().ToList(); - if (item is EveSystemNodeModel node) + + if(_selectedSystemNodes.Count>1 || _selectedSystemLinks.Count>1) { - HandleNodeSelection(node); + SelectedSystemNode = null; + SelectedSystemLink = null; } - else if (item is EveSystemLinkModel link) - { - HandleLinkSelection(link); + else + { + if (item is EveSystemNodeModel node) + { + HandleNodeSelection(node); + } + else if (item is EveSystemLinkModel link) + { + HandleLinkSelection(link); + } } }); }