diff --git a/web/chat/chat-message-list.react.js b/web/chat/chat-message-list.react.js --- a/web/chat/chat-message-list.react.js +++ b/web/chat/chat-message-list.react.js @@ -23,6 +23,7 @@ import { useWatchThread, useExistingThreadInfoFinder, + threadIsPending, } from 'lib/shared/thread-utils'; import type { FetchMessageInfosPayload } from 'lib/types/message-types'; import { type ThreadInfo } from 'lib/types/thread-types'; @@ -426,7 +427,7 @@ return null; } - if (state.navInfo.pendingThread) { + if (threadIsPending(threadInfo?.id)) { return true; } diff --git a/web/redux/nav-reducer.js b/web/redux/nav-reducer.js --- a/web/redux/nav-reducer.js +++ b/web/redux/nav-reducer.js @@ -1,6 +1,7 @@ // @flow import { locallyUniqueToRealizedThreadIDsSelector } from 'lib/selectors/thread-selectors'; +import { threadIsPending } from 'lib/shared/thread-utils'; import type { RawThreadInfo } from 'lib/types/thread-types'; import type { Action } from '../redux/redux-setup'; @@ -35,5 +36,10 @@ } } + if (state.pendingThread && !threadIsPending(state.activeChatThreadID)) { + const { pendingThread, ...stateWithoutPendingThread } = state; + state = stateWithoutPendingThread; + } + return state; }