Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3569453
D4939.id16044.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4939.id16044.diff
View Options
diff --git a/web/chat/chat-message-list-container.react.js b/web/chat/chat-message-list-container.react.js
--- a/web/chat/chat-message-list-container.react.js
+++ b/web/chat/chat-message-list-container.react.js
@@ -52,6 +52,21 @@
threadType: threadTypes.PRIVATE,
}),
);
+
+ const newThreadID = 'pending/new_thread';
+ const pendingNewThread = React.useMemo(
+ () => ({
+ ...createPendingThread({
+ viewerID,
+ threadType: threadTypes.PRIVATE,
+ }),
+ id: newThreadID,
+ uiName: 'New thread',
+ community: null,
+ }),
+ [viewerID],
+ );
+
const existingThreadInfoFinderForCreatingThread = useExistingThreadInfoFinder(
pendingPrivateThread.current,
);
@@ -68,6 +83,10 @@
const existingThreadInfoFinder = useExistingThreadInfoFinder(baseThreadInfo);
const threadInfo = React.useMemo(() => {
if (isChatCreation) {
+ if (userInfoInputArray.length === 0) {
+ return pendingNewThread;
+ }
+
return existingThreadInfoFinderForCreatingThread({
searching: true,
userInfoInputArray,
@@ -83,6 +102,7 @@
existingThreadInfoFinderForCreatingThread,
isChatCreation,
userInfoInputArray,
+ pendingNewThread,
]);
invariant(threadInfo, 'ThreadInfo should be set');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 29, 2:23 AM (9 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2730159
Default Alt Text
D4939.id16044.diff (1 KB)
Attached To
Mode
D4939: [web] Add fake pending thread during chat creation
Attached
Detach File
Event Timeline
Log In to Comment