Try adding validation on PIN entry
MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
<TextBlock VerticalAlignment="Center">Use PIN to unlock the screen.</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Spacing="5" IsVisible="{Binding EnablePINLock, Mode=OneWay}">
- <controls:NoparaPasswordBox Watermark="Enter Old PIN Here."/>
- <controls:NoparaPasswordBox Watermark="Enter New PIN Here."/>
+ <controls:NoparaPasswordBox Watermark="Old PIN" Password="{Binding OldPINPwdBox}" UseFloatingWatermark="True"/>
+ <controls:NoparaPasswordBox Watermark="New PIN" Password="{Binding NewPINPwdBox}" UseFloatingWatermark="True"/>
<Button Content="Confirm"/>
</StackPanel>
</StackPanel>

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -32,6 +32,8 @@ namespace WalletWasabi.Gui.Tabs
private string _finePrivacyLevel;
private string _strongPrivacyLevel;
private string _dustThreshold;
+ private string _oldPINPwdBox;
+ private string _newPINPwdBox;
private AsyncLock ConfigLock { get; } = new AsyncLock();
public ReactiveCommand<Unit, Unit> OpenConfigFileCommand { get; }
@@ -112,7 +114,22 @@ namespace WalletWasabi.Gui.Tabs
{
EnablePINLock = !EnablePINLock;
+ if (!EnablePINLock)
+ {
+ Global.UiConfig.LockScreenPinHash = string.Empty;
+ }
+
+ await Global.UiConfig.ToFileAsync();
+ });
+ SetPINLockCommand = ReactiveCommand.CreateFromTask(async () =>
+ {
+ EnablePINLock = !EnablePINLock;
+
+ if (!EnablePINLock)
+ {
+
+ }
await Global.UiConfig.ToFileAsync();
});
@@ -232,13 +249,25 @@ namespace WalletWasabi.Gui.Tabs
public bool LurkingWifeMode => Global.UiConfig.LurkingWifeMode is true;
-
public bool EnablePINLock
{
get => _enablePINLock;
set => this.RaiseAndSetIfChanged(ref _enablePINLock, value);
}
+ [ValidateMethod(nameof(ValidateOldPINPwdBox))]
+ public string OldPINPwdBox
+ {
+ get => _oldPINPwdBox;
+ set => this.RaiseAndSetIfChanged(ref _oldPINPwdBox, value);
+ }
+
+ [ValidateMethod(nameof(ValidateNewPINPwdBox))]
+ public string NewPINPwdBox
+ {
+ get => _newPINPwdBox;
+ set => this.RaiseAndSetIfChanged(ref _newPINPwdBox, value);
+ }
private void Save()
{
@@ -423,6 +452,28 @@ namespace WalletWasabi.Gui.Tabs
return "Invalid port.";
}
+ private string ValidateOldPINPwdBox()
+ {
+ if (OldPINPwdBox == string.Empty)
+ return "Empty PIN is not allowed.";
+
+ if (OldPINPwdBox != NewPINPwdBox)
+ return "PIN Entries doesnt match.";
+
+ return string.Empty;
+ }
+
+ private object ValidateNewPINPwdBox()
+ {
+ if (NewPINPwdBox == string.Empty)
+ return "Empty PIN is not allowed.";
+
+ if (NewPINPwdBox != OldPINPwdBox)
+ return "PIN Entries doesnt match.";
+
+ return string.Empty;
+ }
+
private void OpenConfigFile()
{
IoHelpers.OpenFileInTextEditor(Global.Config.FilePath);

Try adding validation on PIN entry