Pop up profile selection if bool is false + logic
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
@@ -59,7 +59,7 @@ public partial class ConfirmRecoveryWordsViewModel : RoutableViewModel
private void OnNext(KeyManager keyManager)
{
- Navigate().To(new CoinJoinProfilesViewModel(keyManager));
+ Navigate().To(new CoinJoinProfilesViewModel(keyManager, isNewWallet: true));
}
private void OnCancel()

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfilesViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfilesViewModel.cs
@@ -16,10 +16,10 @@ public partial class CoinJoinProfilesViewModel : RoutableViewModel
{
[AutoNotify] private CoinJoinProfileViewModelBase? _selectedProfile;
- public CoinJoinProfilesViewModel(KeyManager keyManager)
+ public CoinJoinProfilesViewModel(KeyManager keyManager, bool isNewWallet = true)
{
- NextCommand = ReactiveCommand.Create(() => OnNext(keyManager));
- EnableBack = true;
+ NextCommand = ReactiveCommand.Create(() => OnNext(keyManager, isNewWallet));
+ EnableBack = isNewWallet;
var speedyProfile = new SpeedyCoinJoinProfileViewModel();
@@ -55,16 +55,25 @@ public partial class CoinJoinProfilesViewModel : RoutableViewModel
}
}
- private void OnNext(KeyManager keyManager)
+ private void OnNext(KeyManager keyManager, bool isNewWallet)
{
var selected = SelectedProfile ?? SelectedManualProfile ?? Profiles.First();
keyManager.AutoCoinJoin = selected.AutoCoinjoin;
keyManager.SetAnonScoreTargets(selected.MinAnonScoreTarget, selected.MaxAnonScoreTarget, toFile: false);
keyManager.SetFeeRateMedianTimeFrame(selected.FeeRateMedianTimeFrameHours, toFile: false);
+ keyManager.IsCoinjoinProfileSelected = true;
+ if (isNewWallet)
+ {
Navigate().To(new AddedWalletPageViewModel(keyManager));
}
+ else
+ {
+ keyManager.ToFile();
+ Navigate().Clear();
+ }
+ }
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -19,6 +19,7 @@ using WalletWasabi.Fluent.ViewModels.Wallets.Send;
using WalletWasabi.WabiSabi.Client;
using WalletWasabi.Wallets;
using WalletWasabi.Fluent.ViewModels.Wallets.Advanced.WalletCoins;
+using WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
namespace WalletWasabi.Fluent.ViewModels.Wallets;
@@ -71,7 +72,8 @@ public partial class WalletViewModel : WalletViewModelBase
if (Services.HostedServices.GetOrDefault<CoinJoinManager>() is { } coinJoinManager)
{
static bool? MaybeCoinjoining(StatusChangedEventArgs args) =>
- args switch {
+ args switch
+ {
StartedEventArgs _ => true,
StoppedEventArgs _ => false,
CompletedEventArgs => false,
@@ -245,6 +247,10 @@ public partial class WalletViewModel : WalletViewModelBase
}
History.Activate(disposables);
+ if (!Wallet.KeyManager.IsCoinjoinProfileSelected)
+ {
+ Navigate(NavigationTarget.FullScreen).To(new CoinJoinProfilesViewModel(Wallet.KeyManager, isNewWallet: false));
+ }
}
public static WalletViewModel Create(Wallet wallet)

Pop up profile selection if bool is false + logic