fix multi triggers
MODIFY
WalletWasabi.Fluent/Models/UiTriggers.cs
WalletWasabi.Fluent/Models/UiTriggers.cs
@@ -13,6 +13,8 @@ public class UiTriggers
private readonly WalletViewModel _walletViewModel;
private readonly Wallet _wallet;
+ private readonly TimeSpan _throttleTime = TimeSpan.FromMilliseconds(100);
+
public UiTriggers(WalletViewModel walletViewModel)
{
_walletViewModel = walletViewModel;
@@ -33,15 +35,15 @@ public class UiTriggers
/// <summary>
/// Triggers on subscription and when the anon score target changed.
/// </summary>
- public IObservable<Unit> AnonScoreTargetChanged => _walletViewModel.CoinJoinSettings.WhenAnyValue(x => x.AnonScoreTarget).ToSignal().Throttle(TimeSpan.FromMilliseconds(3100));
+ public IObservable<Unit> AnonScoreTargetChanged => _walletViewModel.CoinJoinSettings.WhenAnyValue(x => x.AnonScoreTarget).ToSignal().Throttle(TimeSpan.FromMilliseconds(1000) + _throttleTime).ObserveOn(RxApp.MainThreadScheduler);
/// <summary>
/// Triggers on subscription and when a transaction is processed to the wallet or the USD exchange rate changed.
/// </summary>
- public IObservable<Unit> BalanceUpdateTrigger => TransactionsUpdateTrigger.Merge(UsdExchangeRateChanged);
+ public IObservable<Unit> BalanceUpdateTrigger => TransactionsUpdateTrigger.Merge(UsdExchangeRateChanged).Throttle(_throttleTime).ObserveOn(RxApp.MainThreadScheduler);
/// <summary>
/// Triggers on subscription and when a transaction is processed to the wallet or the anon score target changed.
/// </summary>
- public IObservable<Unit> PrivacyProgressUpdateTrigger => TransactionsUpdateTrigger.Merge(AnonScoreTargetChanged);
+ public IObservable<Unit> PrivacyProgressUpdateTrigger => TransactionsUpdateTrigger.Merge(AnonScoreTargetChanged).Throttle(_throttleTime).ObserveOn(RxApp.MainThreadScheduler);
}

fix multi triggers