Use highestCoinJoinClientState
MODIFY
WalletWasabi.Fluent/App.axaml.cs
WalletWasabi.Fluent/App.axaml.cs
@@ -82,7 +82,7 @@ namespace WalletWasabi.Fluent
if (CanShutdownProvider is { } provider)
{
// Shutdown prevention will only work if you directly run the executable.
- e.Cancel = provider.CanShutdown();
+ e.Cancel = !provider.CanShutdown();
Logger.LogDebug($"Cancellation of the shutdown set to: {e.Cancel}.");
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
+using System;
using WalletWasabi.Fluent.Providers;
+using WalletWasabi.WabiSabi.Client;
namespace WalletWasabi.Fluent.ViewModels
{
public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
{
- bool ICanShutdownProvider.CanShutdown() => Services.WalletManager.AnyCoinJoinInProgress();
+ bool ICanShutdownProvider.CanShutdown()
+ {
+ return Services.HostedServices.Get<CoinJoinManager>().HighestCoinJoinClientState switch
+ {
+ CoinJoinClientState.InCriticalPhase => false,
+ CoinJoinClientState.Idle or CoinJoinClientState.InProgress => true,
+ _ => throw new ArgumentOutOfRangeException(),
+ };
+ }
}
}

Use highestCoinJoinClientState