Add profile selection to AutoCoinJoin setting
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
@@ -5,6 +5,8 @@ using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.Validation;
+using WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
+using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Models;
using WalletWasabi.Wallets;
@@ -46,13 +48,23 @@ public partial class WalletSettingsViewModel : RoutableViewModel
walletViewModelBase.RaisePropertyChanged(nameof(walletViewModelBase.PreferPsbtWorkflow));
});
- this.WhenAnyValue(x => x.AutoCoinJoin)
- .ObserveOn(RxApp.TaskpoolScheduler)
- .Skip(1)
- .Subscribe(x =>
+ SetAutoCoinJoin = ReactiveCommand.Create<bool>(async (x) =>
+ {
+ bool changed = false;
+ if (!_wallet.KeyManager.IsCoinjoinProfileSelected)
+ {
+ DialogResult<bool> isProfileSelected = await NavigateDialogAsync(new CoinJoinProfilesViewModel(_wallet.KeyManager, false), NavigationTarget.DialogScreen);
+ changed = isProfileSelected.Result;
+ }
+ if (changed)
{
_wallet.KeyManager.AutoCoinJoin = x;
_wallet.KeyManager.ToFile();
+ }
+ else
+ {
+ AutoCoinJoin = false;
+ }
});
_minAnonScoreTarget = _wallet.KeyManager.MinAnonScoreTarget;
@@ -114,6 +126,8 @@ public partial class WalletSettingsViewModel : RoutableViewModel
public override sealed string Title { get; protected set; }
+ public ICommand SetAutoCoinJoin { get; }
+
public ICommand VerifyRecoveryWordsCommand { get; }
private void ValidatePlebStopThreshold(IValidationErrors errors) =>

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}" />
+ <ToggleSwitch IsChecked="{Binding AutoCoinJoin}" Command="{Binding SetAutoCoinJoin}" />
</DockPanel>
<StackPanel Spacing="10"

Add profile selection to AutoCoinJoin setting