fix fee slider goes all the way right when navigated away issue
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -54,6 +54,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
private string? _payJoinEndPoint;
private bool _parsingUrl;
private bool _updatingCurrentValue;
+ private double _lastXAxisCurrentValue;
public SendViewModel(WalletViewModel walletVm, TransactionBroadcaster broadcaster)
{
@@ -61,6 +62,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
_owner = walletVm;
_transactionInfo = new TransactionInfo();
_labels = new ObservableCollection<string>();
+ _lastXAxisCurrentValue = _xAxisCurrentValue;
ExchangeRate = walletVm.Wallet.Synchronizer.UsdExchangeRate;
PriorLabels = new();
@@ -80,7 +82,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
if (x > 0)
{
_transactionInfo.FeeRate = new FeeRate(GetYAxisValueFromXAxisCurrentValue(x));
- _transactionInfo.ConfirmationTimeSpan = CalculateConfirmationTime(x);
SetXAxisCurrentValueIndex(x);
}
});
@@ -288,6 +289,13 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
return result;
}
+ protected override void OnNavigatedFrom(bool isInHistory)
+ {
+ base.OnNavigatedFrom(isInHistory);
+ _lastXAxisCurrentValue = XAxisCurrentValue;
+ _transactionInfo.ConfirmationTimeSpan = CalculateConfirmationTime(_lastXAxisCurrentValue);
+ }
+
protected override void OnNavigatedTo(bool inHistory, CompositeDisposable disposables)
{
if (!inHistory)
@@ -297,6 +305,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
Labels.Clear();
ClearValidations();
}
+ else
+ {
+ XAxisCurrentValue = _lastXAxisCurrentValue;
+ }
_owner.Wallet.Synchronizer.WhenAnyValue(x => x.UsdExchangeRate)
.ObserveOn(RxApp.MainThreadScheduler)

fix fee slider goes all the way right when navigated away issue