Composer: Fix problem with scheduled messages (#4136)
This commit is contained in:
parent
d4c16517f0
commit
6a8e685561
@ -941,6 +941,8 @@ const Composer: FC<OwnProps & StateProps> = ({
|
|||||||
if (currentAttachments.length) {
|
if (currentAttachments.length) {
|
||||||
sendAttachments({
|
sendAttachments({
|
||||||
attachments: currentAttachments,
|
attachments: currentAttachments,
|
||||||
|
scheduledAt,
|
||||||
|
isSilent,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1350,9 +1352,8 @@ const Composer: FC<OwnProps & StateProps> = ({
|
|||||||
if (!currentMessageList) {
|
if (!currentMessageList) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
requestCalendar((scheduledAt) => {
|
requestCalendar((scheduledAt) => {
|
||||||
handleMessageSchedule({}, scheduledAt, currentMessageList!);
|
handleMessageSchedule({}, scheduledAt, currentMessageList);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1460,10 +1461,16 @@ const Composer: FC<OwnProps & StateProps> = ({
|
|||||||
sendSilent({ sendCompressed, sendGrouped });
|
sendSilent({ sendCompressed, sendGrouped });
|
||||||
});
|
});
|
||||||
|
|
||||||
const onSend = mainButtonState === MainButtonState.Edit
|
const onSend = useMemo(() => {
|
||||||
? handleEditComplete
|
switch (mainButtonState) {
|
||||||
: mainButtonState === MainButtonState.Schedule ? handleSendScheduled
|
case MainButtonState.Edit:
|
||||||
: handleSend;
|
return handleEditComplete;
|
||||||
|
case MainButtonState.Schedule:
|
||||||
|
return handleSendScheduled;
|
||||||
|
default:
|
||||||
|
return handleSend;
|
||||||
|
}
|
||||||
|
}, [mainButtonState, handleEditComplete]);
|
||||||
|
|
||||||
const withBotCommands = isChatWithBot && botMenuButton?.type === 'commands' && !editingMessage
|
const withBotCommands = isChatWithBot && botMenuButton?.type === 'commands' && !editingMessage
|
||||||
&& botCommands !== false && !activeVoiceRecording;
|
&& botCommands !== false && !activeVoiceRecording;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user