fix time calculation issue
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
using System;
using System.Linq;
+using System.Reactive.Disposables;
using System.Threading.Tasks;
using NBitcoin;
using ReactiveUI;
@@ -22,6 +23,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
private readonly Wallet _wallet;
private readonly TransactionInfo _info;
+ [AutoNotify] private string _confirmationTimeText;
+
public TransactionPreviewViewModel(Wallet wallet, TransactionInfo info, TransactionBroadcaster broadcaster,
BuildTransactionResult transaction)
{
@@ -29,6 +32,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
_info = info;
EnableCancel = true;
EnableBack = true;
+ _confirmationTimeText = "";
var destinationAmount = transaction.CalculateDestinationAmount().ToDecimal(MoneyUnit.BTC);
var btcAmountText = $"{destinationAmount} bitcoins ";
@@ -39,8 +43,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
AddressText = info.Address.ToString();
- ConfirmationTimeText = $"Approximately {TextHelpers.TimeSpanToFriendlyString(info.ConfirmationTimeSpan)} ";
-
var fee = transaction.Fee;
var btcFeeText = $"{fee.ToDecimal(MoneyUnit.Satoshi)} satoshis ";
var fiatFeeText = fee.ToDecimal(MoneyUnit.BTC).GenerateFiatText(wallet.Synchronizer.UsdExchangeRate, "USD");
@@ -58,14 +60,19 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public string AddressText { get; }
- public string ConfirmationTimeText { get; }
-
public string FeeText { get; }
public string? PayJoinUrl { get; }
public bool IsPayJoin { get; }
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ base.OnNavigatedTo(isInHistory, disposables);
+
+ ConfirmationTimeText = $"Approximately {TextHelpers.TimeSpanToFriendlyString(_info.ConfirmationTimeSpan)} ";
+ }
+
private async Task OnNext(Wallet wallet, TransactionBroadcaster broadcaster, BuildTransactionResult transaction)
{
var transactionAuthorizationInfo = new TransactionAuthorizationInfo(transaction);

fix time calculation issue