Fix CJ start on setting AutoCoinJoin
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
@@ -17,6 +17,7 @@ public partial class WalletSettingsViewModel : RoutableViewModel
{
[AutoNotify] private bool _preferPsbtWorkflow;
[AutoNotify] private bool _autoCoinJoin;
+ [AutoNotify] private bool _autoCoinJoinValue;
[AutoNotify] private int _minAnonScoreTarget;
[AutoNotify] private int _maxAnonScoreTarget;
[AutoNotify] private string _plebStopThreshold;
@@ -28,7 +29,7 @@ public partial class WalletSettingsViewModel : RoutableViewModel
_wallet = walletViewModelBase.Wallet;
Title = $"{_wallet.WalletName} - Wallet Settings";
_preferPsbtWorkflow = _wallet.KeyManager.PreferPsbtWorkflow;
- _autoCoinJoin = _wallet.KeyManager.AutoCoinJoin;
+ _autoCoinJoinValue = _wallet.KeyManager.AutoCoinJoin;
IsHardwareWallet = _wallet.KeyManager.IsHardwareWallet;
IsWatchOnly = _wallet.KeyManager.IsWatchOnly;
_plebStopThreshold = _wallet.KeyManager.PlebStopThreshold?.ToString() ?? KeyManager.DefaultPlebStopThreshold.ToString();
@@ -48,7 +49,7 @@ public partial class WalletSettingsViewModel : RoutableViewModel
walletViewModelBase.RaisePropertyChanged(nameof(walletViewModelBase.PreferPsbtWorkflow));
});
- SetAutoCoinJoin = ReactiveCommand.Create<bool>(async (x) =>
+ SetAutoCoinJoin = ReactiveCommand.Create(async () =>
{
if (!_wallet.KeyManager.IsCoinjoinProfileSelected)
{
@@ -57,12 +58,13 @@ public partial class WalletSettingsViewModel : RoutableViewModel
if (_wallet.KeyManager.IsCoinjoinProfileSelected)
{
- _wallet.KeyManager.AutoCoinJoin = x;
+ AutoCoinJoin = AutoCoinJoinValue;
+ _wallet.KeyManager.AutoCoinJoin = !_wallet.KeyManager.AutoCoinJoin;
_wallet.KeyManager.ToFile();
}
else
{
- AutoCoinJoin = false;
+ AutoCoinJoinValue = false;
}
});

MODIFY
WalletWasabi.Fluent/Views/Wallets/WalletSettingsView.axaml
WalletWasabi.Fluent/Views/Wallets/WalletSettingsView.axaml
<DockPanel IsVisible="{Binding !IsWatchOnly}">
<TextBlock Text="Automatic coinjoin" />
- <ToggleSwitch IsChecked="{Binding AutoCoinJoin}" Command="{Binding SetAutoCoinJoin}" />
+ <ToggleSwitch IsChecked="{Binding AutoCoinJoinValue}" Command="{Binding SetAutoCoinJoin}" />
</DockPanel>
<StackPanel Spacing="10"

Fix CJ start on setting AutoCoinJoin