Make sure it works with send, too.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -46,6 +46,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
GenerateCommand = ReactiveCommand.Create(() =>
{
+ Label = Label.Trim(',', ' ').Trim();
if (string.IsNullOrWhiteSpace(Label))
{
LabelRequiredNotificationVisible = true;
@@ -62,7 +63,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Dispatcher.UIThread.Post(() =>
{
- var label = Label.Trim(',', ' ').Trim();
+ var label = Label;
HdPubKey newKey = Global.WalletService.GetReceiveKey(label, Addresses.Select(x => x.Model).Take(7)); // Never touch the first 7 keys.
AddressViewModel found = Addresses.FirstOrDefault(x => x.Model == newKey);
@@ -188,17 +189,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
var enteredWordList = words.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim());
- var lastWordOrNull = enteredWordList.LastOrDefault();
+ var lastWord = enteredWordList?.LastOrDefault()?.Replace("\t", "") ?? "";
- if (lastWordOrNull == null)
- {
- Suggestions?.Clear();
- return;
- }
-
- var lastWord = lastWordOrNull.Replace("\t", "");
-
- if (lastWord.Length < 1)
+ if (!lastWord.Any())
{
Suggestions.Clear();
return;

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -143,6 +143,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
try
{
Password = Guard.Correct(Password);
+ Label = Label.Trim(',', ' ').Trim();
if (!IsMax && string.IsNullOrWhiteSpace(Label))
{
SetWarningMessage("Label is required.");
@@ -179,7 +180,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
return;
}
}
- var label = Label.Trim(',', ' ').Trim();
+ var label = Label;
var operation = new WalletService.Operation(script, amount, label);
try
@@ -775,17 +776,17 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
var enteredWordList = words.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim());
- var lastWorld = enteredWordList.LastOrDefault().Replace("\t", "");
+ var lastWord = enteredWordList?.LastOrDefault()?.Replace("\t", "") ?? "";
- if (lastWorld.Length < 1)
+ if (!lastWord.Any())
{
Suggestions.Clear();
return;
}
string[] nonSpecialLabels = Global.WalletService.GetNonSpecialLabels().ToArray();
- IEnumerable<string> suggestedWords = nonSpecialLabels.Where(w => w.StartsWith(lastWorld, StringComparison.InvariantCultureIgnoreCase))
- .Union(nonSpecialLabels.Where(w => w.Contains(lastWorld, StringComparison.InvariantCultureIgnoreCase)))
+ IEnumerable<string> suggestedWords = nonSpecialLabels.Where(w => w.StartsWith(lastWord, StringComparison.InvariantCultureIgnoreCase))
+ .Union(nonSpecialLabels.Where(w => w.Contains(lastWord, StringComparison.InvariantCultureIgnoreCase)))
.Except(enteredWordList)
.Take(3);

Make sure it works with send, too.