make timer inits unified
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
@@ -63,9 +63,6 @@ public partial class CoinJoinStateViewModel : ViewModelBase
WalletVm = walletVm;
var wallet = walletVm.Wallet;
- _countdownTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
- _countdownTimer.Tick += OnTimerTick;
-
var coinJoinManager = Services.HostedServices.Get<CoinJoinManager>();
Observable.FromEventPattern<StatusChangedEventArgs>(coinJoinManager, nameof(coinJoinManager.StatusChanged))
@@ -146,6 +143,9 @@ public partial class CoinJoinStateViewModel : ViewModelBase
_autoCoinJoinStartTimer.Stop();
};
+ _countdownTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
+ _countdownTimer.Tick += (_, _) => _stateMachine.Fire(Trigger.Tick);
+
_stateMachine.Start();
}
@@ -405,9 +405,4 @@ public partial class CoinJoinStateViewModel : ViewModelBase
RemainingTime = "";
ProgressValue = 0;
}
-
- private void OnTimerTick(object? sender, EventArgs e)
- {
- _stateMachine.Fire(Trigger.Tick);
- }
}

make timer inits unified