implement returning to the send screen when there is a problem with the transaction
MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/INavigationStack.cs
WalletWasabi.Fluent/ViewModels/Navigation/INavigationStack.cs
@@ -18,6 +18,8 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
void BackTo(T viewmodel);
+ void BackTo<TViewModel>() where TViewModel : T;
+
void Clear();
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/NavigationStack.cs
WalletWasabi.Fluent/ViewModels/Navigation/NavigationStack.cs
@@ -115,6 +115,16 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
}
}
+ public void BackTo<TViewModel>() where TViewModel : T
+ {
+ var previous = _backStack.Reverse().SingleOrDefault(x => x is TViewModel);
+
+ if (previous is { })
+ {
+ BackTo(previous);
+ }
+ }
+
public void To(T viewmodel, NavigationMode mode = NavigationMode.Normal)
{
var oldPage = CurrentPage;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
@@ -74,12 +74,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
var transactionResult = TransactionHelpers.BuildTransaction(_wallet, transactionInfo.Address, transactionInfo.Amount, transactionInfo.Labels, transactionInfo.FeeRate, coins, subtractFee: true);
Navigate().To(new TransactionPreviewViewModel(wallet, transactionInfo, broadcaster, transactionResult));
}
+ else
+ {
+ Navigate().BackTo<SendViewModel>();
+ }
}
}
catch (Exception ex)
{
Logger.LogError(ex);
await ShowErrorAsync("Transaction Building", ex.ToUserFriendlyString(), "Wasabi was unable to create your transaction.");
+ Navigate().BackTo<SendViewModel>();
}
},
this.WhenAnyValue(x => x.EnoughSelected));

implement returning to the send screen when there is a problem with the transaction