fee graph waits until it has data to show.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
using System;
using System.Collections.Generic;
+using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using System.Threading.Tasks;
using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.FeesEstimation;
@@ -45,16 +47,15 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
public FeeChartViewModel FeeChart { get; }
-
private void Complete()
{
- var transactionInfo = _transactionInfo;
-
Close(DialogResultKind.Normal, new FeeRate(FeeChart.GetSatoshiPerByte(FeeChart.CurrentConfirmationTarget)));
}
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
+ IsBusy = true;
+
base.OnNavigatedTo(isInHistory, disposables);
var feeProvider = _wallet.FeeProvider;
@@ -69,19 +70,21 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
})
.DisposeWith(disposables);
- if (feeProvider.AllFeeEstimate is { })
+ RxApp.MainThreadScheduler.Schedule(async () =>
+ {
+ while (feeProvider.AllFeeEstimate is null)
{
- FeeChart.UpdateFeeEstimates(_wallet.Network == Network.TestNet ? TestNetFeeEstimates : feeProvider.AllFeeEstimate.Estimations);
+ await Task.Delay(100);
+ }
+
+ FeeChart.UpdateFeeEstimates(_wallet.Network == Network.TestNet
+ ? TestNetFeeEstimates
+ : feeProvider.AllFeeEstimate.Estimations);
if (_transactionInfo.FeeRate is { })
{
FeeChart.InitCurrentConfirmationTarget(_transactionInfo.FeeRate);
}
- }
- else
- {
- // TODO What to do? Perhaps wait for fee provider to be updated.
- }
if (_isSilent)
{
@@ -90,6 +93,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
Complete();
}
+ else
+ {
+ IsBusy = false;
+ }
+ });
}
private TimeSpan CalculateConfirmationTime(double targetBlock)

fee graph waits until it has data to show.