handle hardware and watch only wallets.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
@@ -15,6 +15,7 @@ public partial class CoinJoinStateViewModel : ViewModelBase
{
enum State
{
+ Disabled,
AutoCoinJoin,
ManualCoinJoin,
@@ -86,12 +87,21 @@ public partial class CoinJoinStateViewModel : ViewModelBase
.Select(x=>x.EventArgs)
.Subscribe(StatusChanged);
- _machine =
- new StateMachine<State, Trigger>(walletVm.Settings.AutoCoinJoin
+ var initialState = walletVm.Settings.AutoCoinJoin
? State.AutoCoinJoin
- : State.ManualCoinJoin);
+ : State.ManualCoinJoin;
+
+ if (walletVm.Wallet.KeyManager.IsHardwareWallet || walletVm.Wallet.KeyManager.IsWatchOnly)
+ {
+ initialState = State.Disabled;
+ }
+
+ _machine =
+ new StateMachine<State, Trigger>(initialState);
// See diagram in the developer docs.
+ _machine.Configure(State.Disabled);
+
// Manual Cj State
_machine.Configure(State.ManualCoinJoin)
.Permit(Trigger.AutoCoinJoinOn, State.AutoCoinJoin)
@@ -133,11 +143,6 @@ public partial class CoinJoinStateViewModel : ViewModelBase
})
.OnProcess(UpdateWalletMixedProgress);
- _machine.OnTransitioned((trigger, source, destination) =>
- {
- Console.WriteLine($"Trigger: {trigger} caused state to change from: {source} to {destination}");
- });
-
// AutoCj State
_machine.Configure(State.AutoCoinJoin)
.Permit(Trigger.AutoCoinJoinOff, State.ManualCoinJoin)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/MusicControlsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/MusicControlsViewModel.cs
@@ -11,7 +11,7 @@ public partial class MusicControlsViewModel : ViewModelBase
{
CurrentWallet = wallet;
- IsActive = true;
+ IsActive = !(wallet.Wallet.KeyManager.IsWatchOnly || wallet.Wallet.KeyManager.IsHardwareWallet);
return new CompositeDisposable(
Disposable.Create(() => IsActive = false));

handle hardware and watch only wallets.