lock page fixes

This commit is contained in:
Kyle Spearrin 2019-05-16 08:41:57 -04:00
parent 27b6631cc1
commit 5f6a3f4cb5
5 changed files with 26 additions and 5 deletions

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -33,11 +34,18 @@ namespace Bit.App.Pages
} }
} }
private async void Unlock_Clicked(object sender, EventArgs e) private void Unlock_Clicked(object sender, EventArgs e)
{ {
if(DoOnce()) if(DoOnce())
{ {
await _vm.SubmitAsync(); var tasks = Task.Run(async () =>
{
await Task.Delay(50);
Device.BeginInvokeOnMainThread(async () =>
{
await _vm.SubmitAsync();
});
});
} }
} }

View file

@ -169,6 +169,7 @@ namespace Bit.App.Pages
private async Task SetKeyAndContinueAsync(SymmetricCryptoKey key) private async Task SetKeyAndContinueAsync(SymmetricCryptoKey key)
{ {
await _cryptoService.SetKeyAsync(key); await _cryptoService.SetKeyAsync(key);
DoContinue();
} }
private void DoContinue() private void DoContinue()

View file

@ -3498,6 +3498,15 @@ namespace Bit.App.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Unlock.
/// </summary>
public static string Unlock {
get {
return ResourceManager.GetString("Unlock", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Unlock with {0}. /// Looks up a localized string similar to Unlock with {0}.
/// </summary> /// </summary>

View file

@ -1487,4 +1487,7 @@
<data name="PIN" xml:space="preserve"> <data name="PIN" xml:space="preserve">
<value>PIN</value> <value>PIN</value>
</data> </data>
<data name="Unlock" xml:space="preserve">
<value>Unlock</value>
</data>
</root> </root>

View file

@ -99,7 +99,7 @@ namespace Bit.Core.Services
{ {
_key = new SymmetricCryptoKey(Convert.FromBase64String(key)); _key = new SymmetricCryptoKey(Convert.FromBase64String(key));
} }
return key == null ? null : _key; return _key;
} }
public async Task<string> GetKeyHashAsync() public async Task<string> GetKeyHashAsync()
@ -108,12 +108,12 @@ namespace Bit.Core.Services
{ {
return _keyHash; return _keyHash;
} }
var keyHash = await _secureStorageService.GetAsync<string>(Keys_KeyHash); var keyHash = await _storageService.GetAsync<string>(Keys_KeyHash);
if(keyHash != null) if(keyHash != null)
{ {
_keyHash = keyHash; _keyHash = keyHash;
} }
return keyHash == null ? null : _keyHash; return _keyHash;
} }
public Task<SymmetricCryptoKey> GetEncKeyAsync() public Task<SymmetricCryptoKey> GetEncKeyAsync()