Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3397670
D9449.id31933.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9449.id31933.diff
View Options
diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -1768,30 +1768,12 @@
return chatMentionCandidatesObj;
}
+const emptyMentionCandidates = {};
function useThreadChatMentionCandidates(
+ // eslint-disable-next-line no-unused-vars
threadInfo: ThreadInfo,
): ChatMentionCandidates {
- const { chatMentionCandidatesObj, communityThreadIDForGenesisThreads } =
- useChatMentionCandidatesObjAndUtils();
- return React.useMemo(() => {
- let communityID,
- result = {};
- if (threadInfo.community === genesis.id) {
- communityID = communityThreadIDForGenesisThreads[threadInfo.id];
- } else {
- communityID = threadInfo.community ?? threadInfo.id;
- }
- if (chatMentionCandidatesObj[communityID]) {
- result = { ...chatMentionCandidatesObj[communityID] };
- }
- delete result[threadInfo.id];
- return result;
- }, [
- chatMentionCandidatesObj,
- communityThreadIDForGenesisThreads,
- threadInfo.community,
- threadInfo.id,
- ]);
+ return emptyMentionCandidates;
}
function useUserProfileThreadInfo(userInfo: ?UserInfo): ?UserProfileThreadInfo {
@@ -1852,6 +1834,7 @@
]);
}
+// eslint-disable-next-line no-unused-vars
function useChatMentionSearchIndex(): {
+[id: string]: SentencePrefixSearchIndex,
} {
@@ -1880,20 +1863,12 @@
}, [chatMentionCandidatesObj]);
}
+const emptySearchIndex = new SentencePrefixSearchIndex();
function useThreadChatMentionSearchIndex(
+ // eslint-disable-next-line no-unused-vars
threadInfo: ThreadInfo,
): SentencePrefixSearchIndex {
- const chatMentionCandidatesSearchIndex = useChatMentionSearchIndex();
- const { communityThreadIDForGenesisThreads } =
- useChatMentionCandidatesObjAndUtils();
- if (threadInfo.community === genesis.id) {
- return chatMentionCandidatesSearchIndex[
- communityThreadIDForGenesisThreads[threadInfo.id]
- ];
- }
- return chatMentionCandidatesSearchIndex[
- threadInfo.community ?? threadInfo.id
- ];
+ return emptySearchIndex;
}
export {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 6:53 PM (20 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608464
Default Alt Text
D9449.id31933.diff (2 KB)
Attached To
Mode
D9449: [lib] Disable chat mentioning
Attached
Detach File
Event Timeline
Log In to Comment