Remove unsued code
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceTileViewModel.cs
@@ -17,20 +17,14 @@ public partial class WalletBalanceTileViewModel : TileViewModel
{
private readonly Wallet _wallet;
private readonly IObservable<Unit> _balanceChanged;
- private readonly ObservableCollection<HistoryItemViewModelBase> _history;
[AutoNotify(SetterModifier = AccessModifier.Private)] private string? _balanceBtc;
[AutoNotify(SetterModifier = AccessModifier.Private)] private decimal _balanceFiat;
- [AutoNotify(SetterModifier = AccessModifier.Private)] private string? _recentTransactionName;
- [AutoNotify(SetterModifier = AccessModifier.Private)] private string? _recentTransactionDate;
- [AutoNotify(SetterModifier = AccessModifier.Private)] private string? _recentTransactionStatus;
- [AutoNotify(SetterModifier = AccessModifier.Private)] private bool _showRecentTransaction;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _hasBalance;
public WalletBalanceTileViewModel(WalletViewModel walletVm)
{
_wallet = walletVm.Wallet;
_balanceChanged = walletVm.UiTriggers.BalanceUpdateTrigger;
- _history = walletVm.History.UnfilteredTransactions;
}
protected override void OnActivated(CompositeDisposable disposables)
@@ -40,12 +34,6 @@ public partial class WalletBalanceTileViewModel : TileViewModel
_balanceChanged
.Subscribe(_ => UpdateBalance())
.DisposeWith(disposables);
-
- _history.ToObservableChangeSet()
- .Throttle(TimeSpan.FromMilliseconds(50))
- .ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(_ => UpdateRecentTransaction())
- .DisposeWith(disposables);
}
private void UpdateBalance()
@@ -58,26 +46,4 @@ public partial class WalletBalanceTileViewModel : TileViewModel
HasBalance = totalAmount > Money.Zero;
}
-
- private void UpdateRecentTransaction()
- {
- var recent = _history.FirstOrDefault();
- if (recent is { })
- {
- var isIncoming = recent.IncomingAmount is { };
-
- RecentTransactionName = isIncoming ? "Incoming" : "Outgoing";
- RecentTransactionDate = recent.DateString;
- RecentTransactionStatus = $"{(isIncoming ? recent.IncomingAmount : recent.OutgoingAmount)} BTC - {(recent.IsConfirmed ? "Confirmed" : "Pending")}";
-
- ShowRecentTransaction = true;
- }
- else
- {
- RecentTransactionName = default;
- RecentTransactionDate = default;
- RecentTransactionStatus = default;
- ShowRecentTransaction = false;
- }
- }
}

Remove unsued code