Message List: Fix stuck scheduled loading (#6846)
This commit is contained in:
parent
8f5108cac0
commit
32a0a1e9cd
@ -921,22 +921,24 @@ export default memo(withGlobal<OwnProps>(
|
||||
}
|
||||
|
||||
const messageIds = selectCurrentMessageIds(global, chatId, threadId, type);
|
||||
const chatMessagesById = selectChatMessages(global, chatId);
|
||||
const messagesById = type === 'scheduled'
|
||||
? selectChatScheduledMessages(global, chatId)
|
||||
: selectChatMessages(global, chatId);
|
||||
: chatMessagesById;
|
||||
|
||||
const isSavedDialog = getIsSavedDialog(chatId, threadId, currentUserId);
|
||||
|
||||
if (
|
||||
threadId !== MAIN_THREAD_ID && !isSavedDialog && !chat?.isForum
|
||||
&& !(messagesById && threadId && messagesById[Number(threadId)])
|
||||
&& !(chatMessagesById && threadId && chatMessagesById[Number(threadId)])
|
||||
) {
|
||||
return { currentUserId } as Complete<StateProps>;
|
||||
}
|
||||
|
||||
const isRestricted = selectIsChatRestricted(global, chatId);
|
||||
const restrictionReasons = selectActiveRestrictionReasons(global, chat?.restrictionReasons);
|
||||
const lastMessage = selectChatLastMessage(global, chatId, isSavedDialog ? 'saved' : 'all');
|
||||
const lastMessage = type === 'thread' ? selectChatLastMessage(global, chatId, isSavedDialog ? 'saved' : 'all')
|
||||
: undefined;
|
||||
const focusingId = selectFocusedMessageId(global, chatId);
|
||||
|
||||
const withLastMessageWhenPreloading = (
|
||||
|
||||
@ -1538,7 +1538,6 @@ addActionHandler('loadScheduledHistory', async (global, actions, payload): Promi
|
||||
|
||||
Object.entries(idsByThreadId).forEach(([tId, newThreadScheduledIds]) => {
|
||||
const threadId = tId as ThreadId;
|
||||
if (!chat.isForum && threadId !== MAIN_THREAD_ID) return;
|
||||
global = replaceThreadLocalStateParam(global, chat.id, threadId, 'scheduledIds', newThreadScheduledIds);
|
||||
});
|
||||
setGlobal(global);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user