prevent OnNavigatedTo to be execute twice
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
@@ -28,6 +28,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private decimal _stillNeeded;
[AutoNotify] private bool _enoughSelected;
+ private bool _buildingTransaction;
+
public PrivacyControlViewModel(Wallet wallet, TransactionInfo transactionInfo)
{
_wallet = wallet;
@@ -73,6 +75,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
private async Task OnNextAsync(TransactionInfo transactionInfo,
IObservableList<PocketViewModel> selectedList)
{
+ _buildingTransaction = true;
transactionInfo.Coins = selectedList.Items.SelectMany(x => x.Coins).ToArray();
if (_privatePocket is not null)
@@ -97,6 +100,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
await ShowErrorAsync("Transaction Building", ex.ToUserFriendlyString(), "Wasabi was unable to create your transaction.");
Navigate().BackTo<SendViewModel>();
}
+ finally
+ {
+ _buildingTransaction = false;
+ }
}
private async Task BuildTransactionAsNormalAsync(TransactionInfo transactionInfo)
@@ -139,6 +146,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
+ if (_buildingTransaction)
+ {
+ return;
+ }
+
base.OnNavigatedTo(isInHistory, disposables);
if (!isInHistory)

prevent OnNavigatedTo to be execute twice