From de3e90c6f8bd65bdda03009071152bfdd925ed58 Mon Sep 17 00:00:00 2001 From: Miguel Serra Date: Wed, 22 Nov 2023 14:22:29 +0000 Subject: [PATCH 1/2] Fix wrong sessionService reference --- .../Components/Applications/ApplicationBaseViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COMET.Web.Common/ViewModels/Components/Applications/ApplicationBaseViewModel.cs b/COMET.Web.Common/ViewModels/Components/Applications/ApplicationBaseViewModel.cs index a2250c8b..ac738cb4 100644 --- a/COMET.Web.Common/ViewModels/Components/Applications/ApplicationBaseViewModel.cs +++ b/COMET.Web.Common/ViewModels/Components/Applications/ApplicationBaseViewModel.cs @@ -53,7 +53,7 @@ public abstract class ApplicationBaseViewModel : HaveObjectChangedTracking, IApp protected ApplicationBaseViewModel(ISessionService sessionService) { this.Disposables.Add(CDPMessageBus.Current.Listen() - .Where(x => x.Session == this.SessionService?.Session && x.Status == SessionStatus.EndUpdate) + .Where(x => x.Session == sessionService?.Session && x.Status == SessionStatus.EndUpdate) .SubscribeAsync(_ => this.OnSessionRefreshed())); this.SessionService = sessionService; From 65854dcb690e76e80aaa43af3caad158f31fe1aa Mon Sep 17 00:00:00 2001 From: Miguel Serra Date: Wed, 22 Nov 2023 14:40:49 +0000 Subject: [PATCH 2/2] Initialyze the SessionService before using it --- .../Components/Applications/ApplicationBaseViewModel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/COMET.Web.Common/ViewModels/Components/Applications/ApplicationBaseViewModel.cs b/COMET.Web.Common/ViewModels/Components/Applications/ApplicationBaseViewModel.cs index ac738cb4..907a6548 100644 --- a/COMET.Web.Common/ViewModels/Components/Applications/ApplicationBaseViewModel.cs +++ b/COMET.Web.Common/ViewModels/Components/Applications/ApplicationBaseViewModel.cs @@ -52,11 +52,11 @@ public abstract class ApplicationBaseViewModel : HaveObjectChangedTracking, IApp /// The protected ApplicationBaseViewModel(ISessionService sessionService) { + this.SessionService = sessionService; + this.Disposables.Add(CDPMessageBus.Current.Listen() - .Where(x => x.Session == sessionService?.Session && x.Status == SessionStatus.EndUpdate) + .Where(x => x.Session == this.SessionService?.Session && x.Status == SessionStatus.EndUpdate) .SubscribeAsync(_ => this.OnSessionRefreshed())); - - this.SessionService = sessionService; } ///