diff --git a/lib/components/chat-mention-provider.react.js b/lib/components/chat-mention-provider.react.js --- a/lib/components/chat-mention-provider.react.js +++ b/lib/components/chat-mention-provider.react.js @@ -25,7 +25,7 @@ export type ChatMentionContextType = { +getChatMentionSearchIndex: ( threadInfo: ThreadInfo, - ) => SentencePrefixSearchIndex, + ) => ?SentencePrefixSearchIndex, +getCommunityThreadIDForGenesisThreads: (threadInfo: ThreadInfo) => string, +chatMentionCandidatesObj: ChatMentionCandidatesObj, }; 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 @@ -133,7 +133,7 @@ } function useMentionTypeaheadChatSuggestions( - chatSearchIndex: SentencePrefixSearchIndex, + chatSearchIndex: ?SentencePrefixSearchIndex, chatMentionCandidates: ChatMentionCandidates, typeaheadMatchedStrings: ?TypeaheadMatchedStrings, ): $ReadOnlyArray { @@ -142,7 +142,11 @@ return React.useMemo(() => { const result = []; - if (chatNamePrefix === undefined || chatNamePrefix === null) { + if ( + chatNamePrefix === undefined || + chatNamePrefix === null || + !chatSearchIndex + ) { return result; } diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js --- a/native/chat/chat-input-bar.react.js +++ b/native/chat/chat-input-bar.react.js @@ -297,7 +297,7 @@ +joinThread: (request: ClientThreadJoinRequest) => Promise, +inputState: ?InputState, +userMentionsCandidates: $ReadOnlyArray, - +chatMentionSearchIndex: SentencePrefixSearchIndex, + +chatMentionSearchIndex: ?SentencePrefixSearchIndex, +chatMentionCandidates: ChatMentionCandidates, +parentThreadInfo: ?ThreadInfo, +editedMessagePreview: ?MessagePreviewResult,