From ed2bb9b94e4b64a24fd994ab9475921f4cb2a117 Mon Sep 17 00:00:00 2001 From: Matt Portune Date: Tue, 18 Jan 2022 14:50:04 -0500 Subject: [PATCH] fixes for theme handling on account switching and re-adding existing account --- src/App/App.xaml.cs | 4 ++++ src/App/Utilities/AppHelpers.cs | 5 +++++ src/Core/Services/AuthService.cs | 1 + 3 files changed, 10 insertions(+) diff --git a/src/App/App.xaml.cs b/src/App/App.xaml.cs index ff35cb435..8a337828c 100644 --- a/src/App/App.xaml.cs +++ b/src/App/App.xaml.cs @@ -110,6 +110,10 @@ namespace Bit.App { await AddAccount(); } + else if (message.Command == "accountAdded") + { + UpdateTheme(); + } else if (message.Command == "switchedAccount") { await SwitchedAccountAsync(); diff --git a/src/App/Utilities/AppHelpers.cs b/src/App/Utilities/AppHelpers.cs index 73c8cd177..2ad48dca3 100644 --- a/src/App/Utilities/AppHelpers.cs +++ b/src/App/Utilities/AppHelpers.cs @@ -483,6 +483,11 @@ namespace Bit.App.Utilities settingsService.ClearAsync(userId), vaultTimeoutService.ClearAsync(userId), stateService.ClearAsync(userId)); + if (await stateService.GetActiveUserIdAsync() != null) + { + var messagingService = ServiceContainer.Resolve("messagingService"); + messagingService.Send("switchedAccount"); + } } stateService.BiometricLocked = true; searchService.ClearIndex(); diff --git a/src/Core/Services/AuthService.cs b/src/Core/Services/AuthService.cs index 6a6e95f08..e49bd2150 100644 --- a/src/Core/Services/AuthService.cs +++ b/src/Core/Services/AuthService.cs @@ -370,6 +370,7 @@ namespace Bit.Core.Services } ) ); + _messagingService.Send("accountAdded"); if (_setCryptoKeys) { if (key != null)