show spinner while txn is being recalculated.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -83,9 +83,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
_info.FeeRate = feeRateDialogResult.Result;
}
- _transaction = await BuildTransactionAsync();
+ var newTransaction = await BuildTransactionAsync();
- UpdatePreview();
+ if (newTransaction is { })
+ {
+ UpdateTransaction(newTransaction);
+ }
});
}
@@ -101,6 +104,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
private async Task<BuildTransactionResult?> BuildTransactionAsync()
{
+ IsBusy = true;
+
var transactionInfo = _info;
var targetAnonymitySet = _wallet.ServiceConfiguration.GetMixUntilAnonymitySetValue();
var mixedCoins = _wallet.Coins.Where(x => x.HdPubKey.AnonymitySet >= targetAnonymitySet).ToList();
@@ -147,12 +152,16 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
return null;
}
+ finally
+ {
+ IsBusy = false;
+ }
}
- private void UpdatePreview()
- {
- if (_transaction is { })
+ private void UpdateTransaction(BuildTransactionResult transactionResult)
{
+ _transaction = transactionResult;
+
var destinationAmount = _transaction.CalculateDestinationAmount().ToDecimal(MoneyUnit.BTC);
var btcAmountText = $"{destinationAmount} bitcoins ";
var fiatAmountText =
@@ -165,7 +174,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
.GenerateFiatText(_wallet.Synchronizer.UsdExchangeRate, "USD");
FeeText = $"{btcFeeText}{fiatFeeText}";
}
- }
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
@@ -178,11 +186,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
{
RxApp.MainThreadScheduler.Schedule(async () =>
{
- var transaction = await BuildTransactionAsync();
+ var initialTransaction = await BuildTransactionAsync();
- _transaction = transaction;
-
- UpdatePreview();
+ if (initialTransaction is { })
+ {
+ UpdateTransaction(initialTransaction);
+ }
});
}
}

show spinner while txn is being recalculated.