pop manual fee dialog if there is no fee estimation available
MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
@@ -151,15 +151,18 @@ public abstract partial class RoutableViewModel : ViewModelBase, INavigatable
return result;
}
- protected async Task ShowErrorAsync(string title, string message, string caption)
+ protected async Task ShowErrorAsync(string title, string message, string caption, NavigationTarget target = NavigationTarget.Default)
{
var dialog = new ShowErrorDialogViewModel(message, title, caption);
- var target = CurrentTarget == NavigationTarget.CompactDialogScreen
+ var navigationTarget = target != NavigationTarget.Default
+ ? target
+ : CurrentTarget == NavigationTarget.CompactDialogScreen
? NavigationTarget.CompactDialogScreen
: NavigationTarget.DialogScreen;
- await NavigateDialogAsync(dialog, target);
+
+ await NavigateDialogAsync(dialog, navigationTarget);
}
protected void SetupCancel(bool enableCancel, bool enableCancelOnEscape, bool enableCancelOnPressed)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendFeeViewModel.cs
@@ -57,13 +57,19 @@ public partial class SendFeeViewModel : DialogViewModelBase<FeeRate>
private async Task ShowAdvancedOptionsAsync()
{
- var result = await NavigateDialogAsync(new CustomFeeRateDialogViewModel(_transactionInfo), NavigationTarget.CompactDialogScreen);
- if (result.Result is { } feeRate && feeRate != FeeRate.Zero)
+ var result = await ShowCustomFeeRateDialogAsync();
+ if (result is { } feeRate && feeRate != FeeRate.Zero)
{
- Close(DialogResultKind.Normal, result.Result);
+ Close(DialogResultKind.Normal, feeRate);
}
}
+ private async Task<FeeRate?> ShowCustomFeeRateDialogAsync()
+ {
+ var result = await NavigateDialogAsync(new CustomFeeRateDialogViewModel(_transactionInfo), NavigationTarget.CompactDialogScreen);
+ return result.Result;
+ }
+
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
IsBusy = true;
@@ -86,15 +92,25 @@ public partial class SendFeeViewModel : DialogViewModelBase<FeeRate>
RxApp.MainThreadScheduler.Schedule(async () =>
{
- while (feeProvider.AllFeeEstimate is null)
+ if (!TransactionFeeHelper.TryGetFeeEstimates(_wallet, out var feeEstimates))
{
- await Task.Delay(100);
- }
+ await ShowErrorAsync(
+ "Transaction fee",
+ "Transaction fee estimations are not available at the moment. Alternatively, you can enter the fee rate manually.",
+ "",
+ NavigationTarget.CompactDialogScreen);
- if (!TransactionFeeHelper.TryGetFeeEstimates(_wallet, out var feeEstimates))
+ var customFeeRate = await ShowCustomFeeRateDialogAsync();
+
+ if (customFeeRate is { })
+ {
+ Close(DialogResultKind.Normal, customFeeRate);
+ }
+ else
{
- // TODO: pop manual fee
Close();
+ }
+
return;
}

pop manual fee dialog if there is no fee estimation available