Skip to content

Commit

Permalink
Partially revert WalletWasabi#13175
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandUI committed Jun 26, 2024
1 parent 81b995e commit 414b9ac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion WalletWasabi.Fluent/Extensions/ObservableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static IObservable<T> ReplayLastActive<T>(this IObservable<T> observable)
public static IObservable<(T1, T2, T3)> Flatten<T1, T2, T3>(this IObservable<((T1, T2), T3)> source) =>
source.Select(t => (t.Item1.Item1, t.Item1.Item2, t.Item2));

public static IObservableCache<TObject, TKey> Fetch<TObject, TKey>(this IObservable<Unit> signal, Func<IEnumerable<TObject>> source, Func<TObject, TKey> keySelector, IEqualityComparer<TObject> equalityComparer)
public static IObservableCache<TObject, TKey> Fetch<TObject, TKey>(this IObservable<Unit> signal, Func<IEnumerable<TObject>> source, Func<TObject, TKey> keySelector, IEqualityComparer<TObject>? equalityComparer = null)
where TKey : notnull where TObject : notnull
{
return signal.Select(_ => source())
Expand Down
2 changes: 1 addition & 1 deletion WalletWasabi.Fluent/Models/Wallets/CoinListModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public CoinListModel(Wallet wallet, IWalletModel walletModel)
.Merge(isCoinjoinRunningChanged)
.Publish();

Pockets = signals.Fetch(GetPockets, x => x.Labels, new LambdaComparer<Pocket>((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
Expand Down
2 changes: 1 addition & 1 deletion WalletWasabi.Fluent/Models/Wallets/WalletRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public WalletRepository(IAmountProvider amountProvider)
.StartWith(System.Reactive.Unit.Default);

Wallets =
signals.Fetch(() => Services.WalletManager.GetWallets(), x => x.WalletId, new LambdaComparer<Wallet>((a, b) => Equals(a?.WalletId, b?.WalletId)))
signals.Fetch(() => Services.WalletManager.GetWallets(), x => x.WalletId)
.DisposeWith(_disposable)
.Connect()
.TransformWithInlineUpdate(CreateWalletModel, (_, _) => { })
Expand Down
4 changes: 2 additions & 2 deletions WalletWasabi.Fluent/Models/Wallets/WalletTransactionsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public WalletTransactionsModel(IWalletModel walletModel, Wallet wallet)
Cache =
TransactionProcessed
.Merge(RequestedUnconfirmedTxChainArrived)
.Fetch(BuildSummary, model => model.Id, new LambdaComparer<TransactionModel>((a, b) => Equals(a?.Id, b?.Id)))
.DisposeWith(_disposable);
.Fetch(BuildSummary, model => model.Id)
.DisposeWith(_disposable);

IsEmpty = Cache.Empty();
}
Expand Down

0 comments on commit 414b9ac

Please sign in to comment.