From 414b9acf8ece73b6c566e390b27546052411ccd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20So=C3=B3s?= Date: Wed, 26 Jun 2024 09:08:35 +0200 Subject: [PATCH] Partially revert https://github.com/WalletWasabi/WalletWasabi/pull/13175 --- WalletWasabi.Fluent/Extensions/ObservableExtensions.cs | 2 +- WalletWasabi.Fluent/Models/Wallets/CoinListModel.cs | 2 +- WalletWasabi.Fluent/Models/Wallets/WalletRepository.cs | 2 +- WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WalletWasabi.Fluent/Extensions/ObservableExtensions.cs b/WalletWasabi.Fluent/Extensions/ObservableExtensions.cs index 47c19814276..1a4f6102649 100644 --- a/WalletWasabi.Fluent/Extensions/ObservableExtensions.cs +++ b/WalletWasabi.Fluent/Extensions/ObservableExtensions.cs @@ -108,7 +108,7 @@ public static IObservable ReplayLastActive(this IObservable observable) public static IObservable<(T1, T2, T3)> Flatten(this IObservable<((T1, T2), T3)> source) => source.Select(t => (t.Item1.Item1, t.Item1.Item2, t.Item2)); - public static IObservableCache Fetch(this IObservable signal, Func> source, Func keySelector, IEqualityComparer equalityComparer) + public static IObservableCache Fetch(this IObservable signal, Func> source, Func keySelector, IEqualityComparer? equalityComparer = null) where TKey : notnull where TObject : notnull { return signal.Select(_ => source()) diff --git a/WalletWasabi.Fluent/Models/Wallets/CoinListModel.cs b/WalletWasabi.Fluent/Models/Wallets/CoinListModel.cs index f4d5cc3bdf3..c708058dc5c 100644 --- a/WalletWasabi.Fluent/Models/Wallets/CoinListModel.cs +++ b/WalletWasabi.Fluent/Models/Wallets/CoinListModel.cs @@ -31,7 +31,7 @@ public CoinListModel(Wallet wallet, IWalletModel walletModel) .Merge(isCoinjoinRunningChanged) .Publish(); - Pockets = signals.Fetch(GetPockets, x => x.Labels, new LambdaComparer((a, b) => Equals(a?.Labels, b?.Labels))).DisposeWith(_disposables); + Pockets = signals.Fetch(GetPockets, x => x.Labels).DisposeWith(_disposables); List = Pockets.Connect().MergeMany(x => x.Coins.Select(GetCoinModel).AsObservableChangeSet()).AddKey(x => x.Key).AsObservableCache(); signals diff --git a/WalletWasabi.Fluent/Models/Wallets/WalletRepository.cs b/WalletWasabi.Fluent/Models/Wallets/WalletRepository.cs index 39c4bbd4fc7..bca1464bb1f 100644 --- a/WalletWasabi.Fluent/Models/Wallets/WalletRepository.cs +++ b/WalletWasabi.Fluent/Models/Wallets/WalletRepository.cs @@ -35,7 +35,7 @@ public WalletRepository(IAmountProvider amountProvider) .StartWith(System.Reactive.Unit.Default); Wallets = - signals.Fetch(() => Services.WalletManager.GetWallets(), x => x.WalletId, new LambdaComparer((a, b) => Equals(a?.WalletId, b?.WalletId))) + signals.Fetch(() => Services.WalletManager.GetWallets(), x => x.WalletId) .DisposeWith(_disposable) .Connect() .TransformWithInlineUpdate(CreateWalletModel, (_, _) => { }) diff --git a/WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs b/WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs index d3048e87cdc..28780c31fa0 100644 --- a/WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs +++ b/WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs @@ -53,8 +53,8 @@ public WalletTransactionsModel(IWalletModel walletModel, Wallet wallet) Cache = TransactionProcessed .Merge(RequestedUnconfirmedTxChainArrived) - .Fetch(BuildSummary, model => model.Id, new LambdaComparer((a, b) => Equals(a?.Id, b?.Id))) - .DisposeWith(_disposable); + .Fetch(BuildSummary, model => model.Id) + .DisposeWith(_disposable); IsEmpty = Cache.Empty(); }