1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-19 09:43:27 +00:00

[SG-800] Selecting notification for inactive account on iOS while app is open does not display the request (#2166)

* [SG-800] Remove await from ActionSheet
If the user never answers the pop up, the lock is never released.

* [SG-800] Add try catch
This commit is contained in:
André Bispo
2022-11-04 16:54:16 +00:00
committed by GitHub
parent 02b8e54988
commit 69f02eef82

View File

@@ -221,7 +221,9 @@ namespace Bit.App
} }
var notificationUserEmail = await _stateService.GetEmailAsync(notification.UserId); var notificationUserEmail = await _stateService.GetEmailAsync(notification.UserId);
await Device.InvokeOnMainThreadAsync(async () => Device.BeginInvokeOnMainThread(async () =>
{
try
{ {
var result = await _deviceActionService.DisplayAlertAsync(AppResources.LogInRequested, string.Format(AppResources.LoginAttemptFromXDoYouWantToSwitchToThisAccount, notificationUserEmail), AppResources.Cancel, AppResources.Ok); var result = await _deviceActionService.DisplayAlertAsync(AppResources.LogInRequested, string.Format(AppResources.LoginAttemptFromXDoYouWantToSwitchToThisAccount, notificationUserEmail), AppResources.Cancel, AppResources.Ok);
if (result == AppResources.Ok) if (result == AppResources.Ok)
@@ -229,6 +231,11 @@ namespace Bit.App
await _stateService.SetActiveUserAsync(notification.UserId); await _stateService.SetActiveUserAsync(notification.UserId);
_messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT); _messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT);
} }
}
catch (Exception ex)
{
LoggerHelper.LogEvenIfCantBeResolved(ex);
}
}); });
return true; return true;
} }