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; } ///