diff --git a/src/App/App.xaml.cs b/src/App/App.xaml.cs index 5239a278c..979828212 100644 --- a/src/App/App.xaml.cs +++ b/src/App/App.xaml.cs @@ -221,13 +221,20 @@ namespace Bit.App } var notificationUserEmail = await _stateService.GetEmailAsync(notification.UserId); - await Device.InvokeOnMainThreadAsync(async () => + Device.BeginInvokeOnMainThread(async () => { - var result = await _deviceActionService.DisplayAlertAsync(AppResources.LogInRequested, string.Format(AppResources.LoginAttemptFromXDoYouWantToSwitchToThisAccount, notificationUserEmail), AppResources.Cancel, AppResources.Ok); - if (result == AppResources.Ok) + try { - await _stateService.SetActiveUserAsync(notification.UserId); - _messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT); + var result = await _deviceActionService.DisplayAlertAsync(AppResources.LogInRequested, string.Format(AppResources.LoginAttemptFromXDoYouWantToSwitchToThisAccount, notificationUserEmail), AppResources.Cancel, AppResources.Ok); + if (result == AppResources.Ok) + { + await _stateService.SetActiveUserAsync(notification.UserId); + _messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT); + } + } + catch (Exception ex) + { + LoggerHelper.LogEvenIfCantBeResolved(ex); } }); return true;