fix labels are different
MODIFY
WalletWasabi.Fluent/Helpers/WalletHelpers.cs
WalletWasabi.Fluent/Helpers/WalletHelpers.cs
using System;
+using System.Collections.Generic;
+using System.Linq;
+using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Wallets;
@@ -17,5 +20,21 @@ namespace WalletWasabi.Fluent.Helpers
return keyManager.IsHardwareWallet ? WalletType.Hardware : WalletType.Normal;
}
+
+ public static IEnumerable<string> GetLabels()
+ {
+ // Don't refresh wallet list as it may be slow.
+ IEnumerable<SmartLabel> labels = Services.WalletManager.GetWallets(refreshWalletList: false)
+ .Select(x => x.KeyManager)
+ .SelectMany(x => x.GetLabels());
+
+ var txStore = Services.BitcoinStore.TransactionStore;
+ if (txStore is { })
+ {
+ labels = labels.Concat(txStore.GetLabels());
+ }
+
+ return labels.SelectMany(x => x.Labels);
+ }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveViewModel.cs
@@ -11,7 +11,7 @@ using DynamicData.Binding;
using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Keys;
-using WalletWasabi.Fluent.ViewModels.NavBar;
+using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Wallets;
@@ -37,7 +37,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
{
_wallet = wallet;
_labels = new ObservableCollectionExtended<string>();
- var allLabels = GetLabels();
+ var allLabels = WalletHelpers.GetLabels();
var mostUsedLabels = allLabels.GroupBy(x => x)
.Select(x => new
@@ -118,21 +118,5 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
IsExistingAddressesButtonVisible = _wallet.KeyManager.GetKeys(x => !x.Label.IsEmpty && !x.IsInternal && x.KeyState == KeyState.Clean).Any();
}
-
- private IEnumerable<string> GetLabels()
- {
- // Don't refresh wallet list as it may be slow.
- IEnumerable<SmartLabel> labels = Services.WalletManager.GetWallets(refreshWalletList: false)
- .Select(x => x.KeyManager)
- .SelectMany(x => x.GetLabels());
-
- var txStore = Services.BitcoinStore.TransactionStore;
- if (txStore is { })
- {
- labels = labels.Concat(txStore.GetLabels());
- }
-
- return labels.SelectMany(x => x.Labels);
- }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -289,24 +289,16 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
_wallet.TransactionProcessor.WhenAnyValue(x => x.Coins)
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(x =>
- {
- PriorLabels.AddRange(x.SelectMany(coin => coin.HdPubKey.Label.Labels));
-
- PriorLabels = new ObservableCollection<string>(PriorLabels.Distinct());
- })
+ .Subscribe(_ => UpdateSuggestedLabels())
.DisposeWith(disposables);
- PriorLabels.AddRange(_wallet
- .KeyManager
- .GetLabels()
- .Select(x => x.ToString()
- .Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries))
- .SelectMany(x => x));
-
- PriorLabels = new ObservableCollection<string>(PriorLabels.Distinct());
-
base.OnNavigatedTo(inHistory, disposables);
}
+
+ private void UpdateSuggestedLabels()
+ {
+ var labels = WalletHelpers.GetLabels().Distinct();
+ PriorLabels = new ObservableCollection<string>(labels);
+ }
}
}

fix labels are different