mirror of
https://github.com/bitwarden/android.git
synced 2024-12-18 23:31:52 +03:00
handle locked status better. once locked, stay locked.
This commit is contained in:
parent
27e996dba0
commit
b435256911
3 changed files with 12 additions and 7 deletions
|
@ -221,20 +221,18 @@ namespace Bit.App
|
|||
{
|
||||
_authService.LogOut();
|
||||
|
||||
var deviceApiRepository = Resolver.Resolve<IDeviceApiRepository>();
|
||||
var appIdService = Resolver.Resolve<IAppIdService>();
|
||||
await Task.Run(() => deviceApiRepository.PutClearTokenAsync(appIdService.AppId)).ConfigureAwait(false);
|
||||
|
||||
_googleAnalyticsService.TrackAppEvent("LoggedOut");
|
||||
_googleAnalyticsService.RefreshUserId();
|
||||
|
||||
|
||||
Device.BeginInvokeOnMainThread(() => Current.MainPage = new ExtendedNavigationPage(new HomePage()));
|
||||
if(!string.IsNullOrWhiteSpace(logoutMessage))
|
||||
{
|
||||
_userDialogs.Toast(logoutMessage);
|
||||
}
|
||||
|
||||
var deviceApiRepository = Resolver.Resolve<IDeviceApiRepository>();
|
||||
var appIdService = Resolver.Resolve<IAppIdService>();
|
||||
_settings.Remove(Constants.PushLastRegistrationDate);
|
||||
await Task.Run(() => deviceApiRepository.PutClearTokenAsync(appIdService.AppId)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task CheckLockAsync(bool forceLock)
|
||||
|
@ -246,6 +244,12 @@ namespace Bit.App
|
|||
}
|
||||
|
||||
var lockType = _lockService.GetLockType(forceLock);
|
||||
if(lockType == Enums.LockType.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_settings.AddOrUpdateValue(Constants.Locked, true);
|
||||
switch(lockType)
|
||||
{
|
||||
case Enums.LockType.Fingerprint:
|
||||
|
|
|
@ -337,7 +337,6 @@ namespace Bit.App.Pages
|
|||
private void LockCell_Tapped(object sender, EventArgs e)
|
||||
{
|
||||
_googleAnalyticsService.TrackAppEvent("Locked");
|
||||
_settings.AddOrUpdateValue(Constants.Locked, true);
|
||||
MessagingCenter.Send(Application.Current, "Lock", true);
|
||||
}
|
||||
|
||||
|
|
|
@ -187,6 +187,8 @@ namespace Bit.App.Services
|
|||
Email = null;
|
||||
_cryptoService.Key = null;
|
||||
_settings.Remove(Constants.FirstVaultLoad);
|
||||
_settings.Remove(Constants.PushLastRegistrationDate);
|
||||
_settings.Remove(Constants.Locked);
|
||||
}
|
||||
|
||||
public async Task<ApiResult<TokenResponse>> TokenPostAsync(TokenRequest request)
|
||||
|
|
Loading…
Reference in a new issue