From d7a53da59fb95567278e2b0ee855ffe97c7b2ae1 Mon Sep 17 00:00:00 2001 From: PointStar Date: Tue, 9 Jun 2026 16:10:47 +0300 Subject: [PATCH] =?UTF-8?q?fix(sidebar):=20resolve=20MatchingService=20liv?= =?UTF-8?q?e=20+=20settings=20"=D7=A1=D7=92=D7=95=D7=A8"=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sidebar lookups threw ObjectDisposedException on the EspoCrmClient's HttpClient after any settings save. TryInitializeCrm rebuilds the CRM stack (new HttpClient + MatchingService) and disposes the old HttpClient, but the long-lived sidebar ReadingPaneViewModel had captured the old MatchingService and kept calling into the disposed client. ReadingPaneViewModel now resolves the MatchingService live on each lookup via a Func provider (() => host.MatchingService), so it always uses the current stack and degrades gracefully (shows "not configured") when none exists. SidebarController no longer captures a snapshot. Also: rename the Settings dialog's bottom button from "ביטול" to "סגור". Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Dialogs/SettingsDialog.xaml | 2 +- .../ViewModels/ReadingPaneViewModel.cs | 31 ++++++++++++++++--- src/OutlookAddin/Properties/AssemblyInfo.cs | 4 +-- src/OutlookAddin/Services/AddInHost.cs | 1 - .../Services/SidebarController.cs | 5 +-- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/OutlookAddin.UI/Dialogs/SettingsDialog.xaml b/src/OutlookAddin.UI/Dialogs/SettingsDialog.xaml index 19a094d..1bd3bab 100644 --- a/src/OutlookAddin.UI/Dialogs/SettingsDialog.xaml +++ b/src/OutlookAddin.UI/Dialogs/SettingsDialog.xaml @@ -152,7 +152,7 @@ MinWidth="100" />