Scheduled Messages: Fix duplicated sending (#4513)

This commit is contained in:
Alexander Zinchuk 2024-04-25 21:54:15 +04:00
parent 8b19d5e72c
commit 42c504f805
3 changed files with 16 additions and 2 deletions

View File

@ -567,6 +567,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf || isRepliesChat || isAnonymousForwards);
const noAvatars = Boolean(!withUsers || isChannelChat);
const shouldRenderGreeting = isUserId(chatId) && !isChatWithSelf && !isBot && !isAnonymousForwards
&& type === 'thread'
&& (
(
!messageGroups && !lastMessage && messageIds

View File

@ -700,7 +700,8 @@ export default memo(withGlobal<OwnProps>(
&& !isMessageUnread
&& readDateExpiresAt
&& message.date > Date.now() / 1000 - readDateExpiresAt
&& !userStatus?.isReadDateRestricted,
&& !userStatus?.isReadDateRestricted
&& messageListType !== 'scheduled',
);
const shouldRenderShowWhen = Boolean(
canLoadReadDate && isPrivate && selectUserStatus(global, chat.id)?.isReadDateRestrictedByMe,

View File

@ -419,7 +419,19 @@ export function deleteChatScheduledMessages<T extends GlobalState>(
});
}
global = updateScheduledMessages(global, chatId, newById);
global = {
...global,
scheduledMessages: {
byChatId: {
...global.scheduledMessages.byChatId,
[chatId]: {
byId: {
...newById,
},
},
},
},
};
return global;
}