Changeset View
Changeset View
Standalone View
Standalone View
lib/shared/mention-utils.js
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | return React.useMemo(() => { | ||||
const threadIDs = chatSearchIndex.getSearchResults(chatNamePrefix); | const threadIDs = chatSearchIndex.getSearchResults(chatNamePrefix); | ||||
for (const threadID of threadIDs) { | for (const threadID of threadIDs) { | ||||
if (!chatMentionCandidates[threadID]) { | if (!chatMentionCandidates[threadID]) { | ||||
continue; | continue; | ||||
} | } | ||||
result.push({ | result.push({ | ||||
type: 'chat', | type: 'chat', | ||||
threadInfo: chatMentionCandidates[threadID], | threadInfo: chatMentionCandidates[threadID].threadInfo, | ||||
}); | }); | ||||
} | } | ||||
return result; | return result; | ||||
}, [chatSearchIndex, chatMentionCandidates, chatNamePrefix]); | }, [chatSearchIndex, chatMentionCandidates, chatNamePrefix]); | ||||
} | } | ||||
function getNewTextAndSelection( | function getNewTextAndSelection( | ||||
textBeforeAtSymbol: string, | textBeforeAtSymbol: string, | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |