Scheduled Messages: Fix render errors (#2851)
This commit is contained in:
parent
cbbbd0d374
commit
356c8cd497
@ -248,10 +248,12 @@ const MessageList: FC<OwnProps & StateProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const listedMessages = viewportIds.map((id) => messagesById[id]).filter(Boolean);
|
const listedMessages = viewportIds.map((id) => messagesById[id]).filter(Boolean);
|
||||||
|
|
||||||
|
const orderRule: (keyof ApiMessage)[] = type === 'scheduled' ? ['date', 'id'] : ['id'];
|
||||||
return listedMessages.length
|
return listedMessages.length
|
||||||
? groupMessages(orderBy(listedMessages, 'id'), memoUnreadDividerBeforeIdRef.current)
|
? groupMessages(orderBy(listedMessages, orderRule), memoUnreadDividerBeforeIdRef.current)
|
||||||
: undefined;
|
: undefined;
|
||||||
}, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId]);
|
}, [messageIds, messagesById, threadFirstMessageId, threadTopMessageId, type]);
|
||||||
|
|
||||||
useInterval(() => {
|
useInterval(() => {
|
||||||
if (!messageIds || !messagesById) {
|
if (!messageIds || !messagesById) {
|
||||||
|
|||||||
@ -581,7 +581,7 @@ const AttachmentModal: FC<OwnProps & StateProps> = ({
|
|||||||
onClick={handleSendClick}
|
onClick={handleSendClick}
|
||||||
onContextMenu={canShowCustomSendMenu ? handleContextMenu : undefined}
|
onContextMenu={canShowCustomSendMenu ? handleContextMenu : undefined}
|
||||||
>
|
>
|
||||||
{lang('Send')}
|
{shouldSchedule ? lang('Next') : lang('Send')}
|
||||||
</Button>
|
</Button>
|
||||||
{canShowCustomSendMenu && (
|
{canShowCustomSendMenu && (
|
||||||
<CustomSendMenu
|
<CustomSendMenu
|
||||||
|
|||||||
@ -1248,6 +1248,7 @@ const Composer: FC<OwnProps & StateProps> = ({
|
|||||||
shouldForceCompression={shouldForceCompression}
|
shouldForceCompression={shouldForceCompression}
|
||||||
shouldForceAsFile={shouldForceAsFile}
|
shouldForceAsFile={shouldForceAsFile}
|
||||||
isForCurrentMessageList={isForCurrentMessageList}
|
isForCurrentMessageList={isForCurrentMessageList}
|
||||||
|
shouldSchedule={shouldSchedule}
|
||||||
onCaptionUpdate={onCaptionUpdate}
|
onCaptionUpdate={onCaptionUpdate}
|
||||||
onSendSilent={handleSendSilentAttachments}
|
onSendSilent={handleSendSilentAttachments}
|
||||||
onSend={handleSendAttachments}
|
onSend={handleSendAttachments}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user