1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-22 03:03:46 +00:00

PM-2575 Fixed extension freeze when using the return button on the keyboard when unlocking the extension. Also added way to prevent multiple executions of checking the password and logging exceptions. (#2568)

This commit is contained in:
Federico Maccaroni
2023-06-13 22:38:08 +02:00
committed by GitHub
parent 1332ef7b43
commit 98705e443f
4 changed files with 99 additions and 84 deletions

View File

@@ -6435,7 +6435,7 @@ namespace Bit.App.Resources {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Unlocking may fail due to insufficient memory. Decrease your KDF memory settings to resolve. /// Looks up a localized string similar to Unlocking may fail due to insufficient memory. Decrease your KDF memory settings to resolve..
/// </summary> /// </summary>
public static string UnlockingMayFailDueToInsufficientMemoryDecreaseYourKDFMemorySettingsToResolve { public static string UnlockingMayFailDueToInsufficientMemoryDecreaseYourKDFMemorySettingsToResolve {
get { get {

View File

@@ -2635,6 +2635,6 @@ Do you want to switch to this account?</value>
<value>Master password re-prompt help</value> <value>Master password re-prompt help</value>
</data> </data>
<data name="UnlockingMayFailDueToInsufficientMemoryDecreaseYourKDFMemorySettingsToResolve" xml:space="preserve"> <data name="UnlockingMayFailDueToInsufficientMemoryDecreaseYourKDFMemorySettingsToResolve" xml:space="preserve">
<value>Unlocking may fail due to insufficient memory. Decrease your KDF memory settings to resolve</value> <value>Unlocking may fail due to insufficient memory. Decrease your KDF memory settings to resolve.</value>
</data> </data>
</root> </root>

View File

@@ -1,5 +1,6 @@
using System; using System;
using Bit.App.Controls; using Bit.App.Controls;
using Bit.Core.Utilities;
using Bit.iOS.Core.Utilities; using Bit.iOS.Core.Utilities;
using UIKit; using UIKit;
@@ -44,7 +45,7 @@ namespace Bit.iOS.Autofill
partial void SubmitButton_Activated(UIBarButtonItem sender) partial void SubmitButton_Activated(UIBarButtonItem sender)
{ {
var task = CheckPasswordAsync(); CheckPasswordAsync().FireAndForget();
} }
partial void CancelButton_Activated(UIBarButtonItem sender) partial void CancelButton_Activated(UIBarButtonItem sender)

View File

@@ -36,6 +36,7 @@ namespace Bit.iOS.Core.Controllers
private bool _passwordReprompt = false; private bool _passwordReprompt = false;
private bool _usesKeyConnector; private bool _usesKeyConnector;
private bool _biometricUnlockOnly = false; private bool _biometricUnlockOnly = false;
private bool _checkingPassword;
protected bool autofillExtension = false; protected bool autofillExtension = false;
@@ -154,7 +155,7 @@ namespace Bit.iOS.Core.Controllers
MasterPasswordCell.TextField.ReturnKeyType = UIReturnKeyType.Go; MasterPasswordCell.TextField.ReturnKeyType = UIReturnKeyType.Go;
MasterPasswordCell.TextField.ShouldReturn += (UITextField tf) => MasterPasswordCell.TextField.ShouldReturn += (UITextField tf) =>
{ {
CheckPasswordAsync().GetAwaiter().GetResult(); CheckPasswordAsync().FireAndForget();
return true; return true;
}; };
if (_pinLock) if (_pinLock)
@@ -210,6 +211,14 @@ namespace Bit.iOS.Core.Controllers
} }
protected async Task CheckPasswordAsync() protected async Task CheckPasswordAsync()
{
if (_checkingPassword)
{
return;
}
_checkingPassword = true;
try
{ {
if (string.IsNullOrWhiteSpace(MasterPasswordCell.TextField.Text)) if (string.IsNullOrWhiteSpace(MasterPasswordCell.TextField.Text))
{ {
@@ -311,6 +320,11 @@ namespace Bit.iOS.Core.Controllers
} }
} }
} }
finally
{
_checkingPassword = false;
}
}
private async Task HandleFailedCredentialsAsync() private async Task HandleFailedCredentialsAsync()
{ {