[skip ci] fix errors at deleting words
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
@@ -168,8 +168,11 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
private void UpdateSuggestions(string words)
{
- if (string.IsNullOrEmpty(words))
+ if (string.IsNullOrWhiteSpace(words))
+ {
+ Suggestions?.Clear();
return;
+ }
string[] enteredWordList = words.Split(' ', StringSplitOptions.RemoveEmptyEntries);
var lastWorld = enteredWordList.LastOrDefault().Replace("\t", "");
@@ -180,7 +183,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
return;
}
- var suggestedWords = EnglishWords.Where(w => w.StartsWith(lastWorld));
+ var suggestedWords = EnglishWords.Where(w => w.StartsWith(lastWorld)).Take(7);
_suggestions.Clear();
foreach (var suggestion in suggestedWords)
@@ -192,8 +195,15 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
public void OnAddWord(string word)
{
string[] words = MnemonicWords.Split(' ', StringSplitOptions.RemoveEmptyEntries);
+ if (words.Length == 0)
+ {
+ MnemonicWords = word + " ";
+ }
+ else
+ {
words[words.Length - 1] = word;
MnemonicWords = string.Join(' ', words) + " ";
+ }
CaretIndex = MnemonicWords.Length;

[skip ci] fix errors at deleting words