Skip to content

Commit 2c8fd08

Browse files
authored
Merge pull request WalletWasabi#4420 from nopara73/1600785349
Remove initialvalue
2 parents fb6eaf8 + 1a8862e commit 2c8fd08

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public abstract class SendControlViewModel : WasabiDocumentTabViewModel, IWallet
5757
private bool _isBusy;
5858
private bool _isHardwareBusy;
5959
private bool _isCustomFee;
60-
private ObservableAsPropertyHelper<bool> _isEstimateAvailabe;
6160

6261
private const string WaitingForHardwareWalletButtonTextString = "Waiting for Hardware Wallet...";
6362

@@ -554,7 +553,7 @@ public bool IsCustomFee
554553
private set => this.RaiseAndSetIfChanged(ref _isCustomFee, value);
555554
}
556555

557-
public bool IsEstimateAvailable => _isEstimateAvailabe?.Value ?? false;
556+
public bool IsEstimateAvailable => Global.FeeProviders?.AllFeeEstimate is { };
558557

559558
public string AmountWatermarkText
560559
{
@@ -872,12 +871,14 @@ private void ValidateCustomChangeAddress(IValidationErrors errors)
872871

873872
public override void OnOpen(CompositeDisposable disposables)
874873
{
875-
_isEstimateAvailabe = Observable
874+
Observable
876875
.FromEventPattern<AllFeeEstimate>(Global.FeeProviders, nameof(Global.FeeProviders.AllFeeEstimateChanged))
877-
.Select(x => x.EventArgs is { })
878-
.ToProperty(this, x => x.IsEstimateAvailable, scheduler: RxApp.MainThreadScheduler, initialValue: Global.FeeProviders?.AllFeeEstimate is { })
876+
.ObserveOn(RxApp.MainThreadScheduler)
877+
.Subscribe(_ => this.RaisePropertyChanged(nameof(IsEstimateAvailable)))
879878
.DisposeWith(disposables);
880879

880+
this.RaisePropertyChanged(nameof(IsEstimateAvailable));
881+
881882
Observable
882883
.FromEventPattern<AllFeeEstimate>(Global.FeeProviders, nameof(Global.FeeProviders.AllFeeEstimateChanged))
883884
.ObserveOn(RxApp.MainThreadScheduler)

0 commit comments

Comments
 (0)