Update % when AnonScore changes in CJ settings
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinSettingsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinSettingsViewModel.cs
@@ -16,6 +16,7 @@ public partial class CoinJoinSettingsViewModel : RoutableViewModel
{
private readonly Wallet _wallet;
[AutoNotify] private bool _autoCoinJoin;
+ [AutoNotify] private int _anonScoreTarget;
[AutoNotify] private bool _isCoinjoinProfileSelected;
[AutoNotify] private string _plebStopThreshold;
[AutoNotify] private string? _selectedCoinjoinProfileName;
@@ -58,6 +59,14 @@ public partial class CoinJoinSettingsViewModel : RoutableViewModel
SelectCoinjoinProfileCommand = ReactiveCommand.CreateFromTask(SelectCoinjoinProfileAsync);
+ _anonScoreTarget = _wallet.KeyManager.AnonScoreTarget;
+
+ this.WhenAnyValue(x => x.AnonScoreTarget)
+ .ObserveOn(RxApp.TaskpoolScheduler)
+ .Throttle(TimeSpan.FromMilliseconds(1000))
+ .Skip(1)
+ .Subscribe(_ => _wallet.KeyManager.SetAnonScoreTarget(AnonScoreTarget));
+
this.WhenAnyValue(x => x.PlebStopThreshold)
.Skip(1)
.Throttle(TimeSpan.FromMilliseconds(1000))
@@ -81,6 +90,7 @@ public partial class CoinJoinSettingsViewModel : RoutableViewModel
{
base.OnNavigatedTo(isInHistory, disposables);
PlebStopThreshold = _wallet.KeyManager.PlebStopThreshold.ToString();
+ AnonScoreTarget = _wallet.KeyManager.AnonScoreTarget;
IsCoinjoinProfileSelected = _wallet.KeyManager.IsCoinjoinProfileSelected;
SelectedCoinjoinProfileName =

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
@@ -11,7 +11,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets;
public partial class WalletSettingsViewModel : RoutableViewModel
{
private readonly Wallet _wallet;
- [AutoNotify] private int _anonScoreTarget;
[AutoNotify] private string _plebStopThreshold;
[AutoNotify] private bool _preferPsbtWorkflow;
@@ -41,14 +40,6 @@ public partial class WalletSettingsViewModel : RoutableViewModel
_wallet.KeyManager.ToFile();
walletViewModelBase.RaisePropertyChanged(nameof(walletViewModelBase.PreferPsbtWorkflow));
});
-
- _anonScoreTarget = _wallet.KeyManager.AnonScoreTarget;
-
- this.WhenAnyValue(x => x.AnonScoreTarget)
- .ObserveOn(RxApp.TaskpoolScheduler)
- .Throttle(TimeSpan.FromMilliseconds(1000))
- .Skip(1)
- .Subscribe(_ => _wallet.KeyManager.SetAnonScoreTarget(AnonScoreTarget));
}
public bool IsHardwareWallet { get; }
@@ -58,10 +49,4 @@ public partial class WalletSettingsViewModel : RoutableViewModel
public sealed override string Title { get; protected set; }
public ICommand VerifyRecoveryWordsCommand { get; }
-
- protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
- {
- base.OnNavigatedTo(isInHistory, disposables);
- AnonScoreTarget = _wallet.KeyManager.AnonScoreTarget;
- }
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -60,7 +60,7 @@ public partial class WalletViewModel : WalletViewModelBase
.Select(_ => Unit.Default))
.Merge(Services.UiConfig.WhenAnyValue(x => x.PrivacyMode).Select(_ => Unit.Default))
.Merge(Wallet.Synchronizer.WhenAnyValue(x => x.UsdExchangeRate).Select(_ => Unit.Default))
- .Merge(Settings.WhenAnyValue(x => x.AnonScoreTarget).Select(_ => Unit.Default).Skip(1).Throttle(TimeSpan.FromMilliseconds(3000))
+ .Merge(CoinJoinSettings.WhenAnyValue(x => x.AnonScoreTarget).Select(_ => Unit.Default).Skip(1).Throttle(TimeSpan.FromMilliseconds(3000))
.Throttle(TimeSpan.FromSeconds(0.1))
.ObserveOn(RxApp.MainThreadScheduler));

Update % when AnonScore changes in CJ settings