diff --git a/src/components/middle/MessageList.tsx b/src/components/middle/MessageList.tsx index 58ab45707..b1534e19e 100644 --- a/src/components/middle/MessageList.tsx +++ b/src/components/middle/MessageList.tsx @@ -248,10 +248,12 @@ const MessageList: FC = ({ } const listedMessages = viewportIds.map((id) => messagesById[id]).filter(Boolean); + + const orderRule: (keyof ApiMessage)[] = type === 'scheduled' ? ['date', 'id'] : ['id']; return listedMessages.length - ? groupMessages(orderBy(listedMessages, 'id'), memoUnreadDividerBeforeIdRef.current) + ? groupMessages(orderBy(listedMessages, orderRule), memoUnreadDividerBeforeIdRef.current) : undefined; - }, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId]); + }, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId, type]); useInterval(() => { if (!messageIds || !messagesById) { diff --git a/src/components/middle/composer/AttachmentModal.tsx b/src/components/middle/composer/AttachmentModal.tsx index b08a464f0..656c4db27 100644 --- a/src/components/middle/composer/AttachmentModal.tsx +++ b/src/components/middle/composer/AttachmentModal.tsx @@ -581,7 +581,7 @@ const AttachmentModal: FC = ({ onClick={handleSendClick} onContextMenu={canShowCustomSendMenu ? handleContextMenu : undefined} > - {lang('Send')} + {shouldSchedule ? lang('Next') : lang('Send')} {canShowCustomSendMenu && ( = ({ shouldForceCompression={shouldForceCompression} shouldForceAsFile={shouldForceAsFile} isForCurrentMessageList={isForCurrentMessageList} + shouldSchedule={shouldSchedule} onCaptionUpdate={onCaptionUpdate} onSendSilent={handleSendSilentAttachments} onSend={handleSendAttachments}