diff --git a/lib/shared/mention-utils.js b/lib/shared/mention-utils.js --- a/lib/shared/mention-utils.js +++ b/lib/shared/mention-utils.js @@ -123,10 +123,7 @@ chatNamePrefix: string, ): $ReadOnlyArray { const result = []; - const threadIDs = - chatNamePrefix.length === 0 - ? chatSearchIndex.entries - : chatSearchIndex.getSearchResults(chatNamePrefix); + const threadIDs = chatSearchIndex.getSearchResults(chatNamePrefix); for (const threadID of threadIDs) { if (!chatMentionCandidates[threadID]) { continue; diff --git a/lib/shared/sentence-prefix-search-index.js b/lib/shared/sentence-prefix-search-index.js --- a/lib/shared/sentence-prefix-search-index.js +++ b/lib/shared/sentence-prefix-search-index.js @@ -9,11 +9,8 @@ const tokenize = new Tokenizer().re(/\S+/); class SentencePrefixSearchIndex extends SearchIndex { - entries: Set; - constructor() { super(tokenize); - this.entries = new Set(); } addEntry(id: string, rawText: string) { @@ -22,7 +19,6 @@ const value = rawText.slice(keyword.index).toLowerCase(); this.addAllPrefixes(id, value); } - this.entries.add(id); } getSearchResults(query: string): string[] {