Page MenuHomePhabricator

D4939.diff
No OneTemporary

D4939.diff

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,20 @@
threadType: threadTypes.PRIVATE,
}),
);
+
+ const newThreadID = 'pending/new_thread';
+ const pendingNewThread = React.useMemo(
+ () => ({
+ ...createPendingThread({
+ viewerID,
+ threadType: threadTypes.PRIVATE,
+ name: 'New thread',
+ }),
+ id: newThreadID,
+ }),
+ [viewerID],
+ );
+
const existingThreadInfoFinderForCreatingThread = useExistingThreadInfoFinder(
pendingPrivateThread.current,
);
@@ -68,6 +82,10 @@
const existingThreadInfoFinder = useExistingThreadInfoFinder(baseThreadInfo);
const threadInfo = React.useMemo(() => {
if (isChatCreation) {
+ if (userInfoInputArray.length === 0) {
+ return pendingNewThread;
+ }
+
return existingThreadInfoFinderForCreatingThread({
searching: true,
userInfoInputArray,
@@ -83,6 +101,7 @@
existingThreadInfoFinderForCreatingThread,
isChatCreation,
userInfoInputArray,
+ pendingNewThread,
]);
invariant(threadInfo, 'ThreadInfo should be set');

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 28, 10:43 AM (8 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2725727
Default Alt Text
D4939.diff (1 KB)

Event Timeline