Improve PIN verifications
MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -99,21 +99,21 @@ namespace WalletWasabi.Gui.Tabs
SetClearPinCommand = ReactiveCommand.Create(() =>
{
var pinBoxText = PinBoxText?.Trim();
- if (string.IsNullOrWhiteSpace(pinBoxText))
+ if (string.IsNullOrEmpty(PinBoxText))
{
- NotificationHelpers.Error("Please provide a PIN.");
+ NotificationHelpers.Error("Please provide a PIN");
return;
}
- if (pinBoxText.Length > 10)
+ if (PinBoxText.Any(x => !char.IsDigit(x)))
{
- NotificationHelpers.Error("PIN is too long.");
+ NotificationHelpers.Error("Invalid PIN.");
return;
}
- if (pinBoxText.Any(x => !char.IsDigit(x)))
+ if (PinBoxText.Length > 10)
{
- NotificationHelpers.Error("Invalid PIN.");
+ NotificationHelpers.Error("PIN is too long.");
return;
}

Improve PIN verifications