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 @@ -14,6 +14,7 @@ useWatchThread, useExistingThreadInfoFinder, createPendingThread, + threadIsPending, } from 'lib/shared/thread-utils'; import { threadTypes } from 'lib/types/thread-types'; import type { AccountUserInfo } from 'lib/types/user-types'; @@ -110,6 +111,30 @@ userInfoInputArray, ]); + React.useEffect(() => { + if (isChatCreation && activeChatThreadID !== threadInfo?.id) { + let payload = { + activeChatThreadID: threadInfo?.id, + }; + if (threadIsPending(activeChatThreadID)) { + payload = { + ...payload, + pendingThread: threadInfo, + }; + } + dispatch({ + type: updateNavInfoActionType, + payload, + }); + } + }, [ + activeChatThreadID, + dispatch, + isChatCreation, + threadInfo, + threadInfo?.id, + ]); + const inputState = React.useContext(InputStateContext); const [{ isActive }, connectDropTarget] = useDrop({ accept: NativeTypes.FILE,