mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03: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:
parent
02b8e54988
commit
69f02eef82
1 changed files with 12 additions and 5 deletions
|
@ -221,13 +221,20 @@ namespace Bit.App
|
||||||
}
|
}
|
||||||
|
|
||||||
var notificationUserEmail = await _stateService.GetEmailAsync(notification.UserId);
|
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);
|
try
|
||||||
if (result == AppResources.Ok)
|
|
||||||
{
|
{
|
||||||
await _stateService.SetActiveUserAsync(notification.UserId);
|
var result = await _deviceActionService.DisplayAlertAsync(AppResources.LogInRequested, string.Format(AppResources.LoginAttemptFromXDoYouWantToSwitchToThisAccount, notificationUserEmail), AppResources.Cancel, AppResources.Ok);
|
||||||
_messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT);
|
if (result == AppResources.Ok)
|
||||||
|
{
|
||||||
|
await _stateService.SetActiveUserAsync(notification.UserId);
|
||||||
|
_messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LoggerHelper.LogEvenIfCantBeResolved(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue