From be28f41b546772669518f3273d21e3d7edd47200 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Fri, 20 Feb 2026 07:31:33 -0500 Subject: [PATCH] Fix newly added servers not appearing on Overview until restart (fixes #199) LandingPage created its own ServerManager instance, so its in-memory server list was stale after MainWindow added a server. Now MainWindow passes its ServerManager to LandingPage so they share the same instance. Co-Authored-By: Claude Opus 4.6 --- Dashboard/Controls/LandingPage.xaml.cs | 4 ++-- Dashboard/MainWindow.xaml.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dashboard/Controls/LandingPage.xaml.cs b/Dashboard/Controls/LandingPage.xaml.cs index 0355b270..3e35e23a 100644 --- a/Dashboard/Controls/LandingPage.xaml.cs +++ b/Dashboard/Controls/LandingPage.xaml.cs @@ -30,11 +30,11 @@ public partial class LandingPage : UserControl public event EventHandler? ServerCardClicked; - public LandingPage() + public LandingPage(ServerManager? serverManager = null) { InitializeComponent(); - _serverManager = new ServerManager(); + _serverManager = serverManager ?? new ServerManager(); _preferencesService = new UserPreferencesService(); _credentialService = new CredentialService(); _serverHealthStatuses = new ObservableCollection(); diff --git a/Dashboard/MainWindow.xaml.cs b/Dashboard/MainWindow.xaml.cs index fb49ecc0..e6f76277 100644 --- a/Dashboard/MainWindow.xaml.cs +++ b/Dashboard/MainWindow.xaml.cs @@ -554,7 +554,7 @@ private void OpenNocTab() } // Create the landing page - _landingPage = new LandingPage(); + _landingPage = new LandingPage(_serverManager); _landingPage.ServerCardClicked += LandingPage_ServerCardClicked; // Create tab header with close button