Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32167627
D10461.1765052851.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10461.1765052851.diff
View Options
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
@@ -13,6 +13,7 @@
ThreadInfo,
} from '../types/thread-types.js';
import { useResolvedThreadInfosObj } from '../utils/entity-helpers.js';
+import { getNameForThreadEntity } from '../utils/entity-text.js';
import { useSelector } from '../utils/redux-utils.js';
type Props = {
@@ -245,14 +246,23 @@
uiName:
chatMentionCandidatesObj[communityThreadID][threadID].threadInfo
.uiName,
+ rawChatName:
+ chatMentionCandidatesObj[communityThreadID][threadID].rawChatName,
});
}
// Sort the keys so that the order of the search result is consistent
searchIndexEntries.sort(({ uiName: uiNameA }, { uiName: uiNameB }) =>
uiNameA.localeCompare(uiNameB),
);
- for (const { id, uiName } of searchIndexEntries) {
- searchIndex.addEntry(id, uiName);
+ for (const { id, uiName, rawChatName } of searchIndexEntries) {
+ const names = [uiName];
+ if (rawChatName) {
+ typeof rawChatName === 'string'
+ ? names.push(rawChatName)
+ : names.push(getNameForThreadEntity(rawChatName));
+ }
+
+ searchIndex.addEntry(id, names.join(' '));
}
result[communityThreadID] = searchIndex;
}
diff --git a/lib/utils/entity-text.js b/lib/utils/entity-text.js
--- a/lib/utils/entity-text.js
+++ b/lib/utils/entity-text.js
@@ -585,6 +585,7 @@
ET,
entityTextToRawString,
entityTextToReact,
+ getNameForThreadEntity,
pluralizeEntityText,
useENSNamesForEntityText,
useEntityTextAsString,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 8:27 PM (13 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5840632
Default Alt Text
D10461.1765052851.diff (1 KB)
Attached To
Mode
D10461: [lib] Include the rawChatName when constructing the chat mention search index
Attached
Detach File
Event Timeline
Log In to Comment