mirror of
https://github.com/bitwarden/mobile
synced 2025-12-14 07:13:33 +00:00
clear value after invalid pin
This commit is contained in:
@@ -51,13 +51,7 @@ namespace Bit.iOS.Extension
|
||||
|
||||
private void PinTextField_EditingChanged(object sender, EventArgs e)
|
||||
{
|
||||
var newText = string.Empty;
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
newText += PinTextField.Text.Length <= i ? "- " : "● ";
|
||||
}
|
||||
|
||||
PinLabel.Text = newText.TrimEnd();
|
||||
SetLabelText();
|
||||
|
||||
if(PinTextField.Text.Length >= 4)
|
||||
{
|
||||
@@ -70,14 +64,28 @@ namespace Bit.iOS.Extension
|
||||
{
|
||||
// TODO: keep track of invalid attempts and logout?
|
||||
|
||||
var alert = Dialogs.CreateAlert(null, "Invalid PIN. Try again.", AppResources.Ok);
|
||||
var alert = Dialogs.CreateAlert(null, "Invalid PIN. Try again.", AppResources.Ok, (a) =>
|
||||
{
|
||||
PinTextField.Text = string.Empty;
|
||||
SetLabelText();
|
||||
PinTextField.BecomeFirstResponder();
|
||||
});
|
||||
PresentViewController(alert, true, null);
|
||||
PinTextField.Text = string.Empty;
|
||||
PinTextField.BecomeFirstResponder();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetLabelText()
|
||||
{
|
||||
var newText = string.Empty;
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
newText += PinTextField.Text.Length <= i ? "- " : "● ";
|
||||
}
|
||||
|
||||
PinLabel.Text = newText.TrimEnd();
|
||||
}
|
||||
|
||||
partial void CancelButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
CompleteRequest();
|
||||
|
||||
Reference in New Issue
Block a user