Scheduled Messages: Fix duplicated sending (#4513)
This commit is contained in:
parent
8b19d5e72c
commit
42c504f805
@ -567,6 +567,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
|
|||||||
const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf || isRepliesChat || isAnonymousForwards);
|
const withUsers = Boolean((!isPrivate && !isChannelChat) || isChatWithSelf || isRepliesChat || isAnonymousForwards);
|
||||||
const noAvatars = Boolean(!withUsers || isChannelChat);
|
const noAvatars = Boolean(!withUsers || isChannelChat);
|
||||||
const shouldRenderGreeting = isUserId(chatId) && !isChatWithSelf && !isBot && !isAnonymousForwards
|
const shouldRenderGreeting = isUserId(chatId) && !isChatWithSelf && !isBot && !isAnonymousForwards
|
||||||
|
&& type === 'thread'
|
||||||
&& (
|
&& (
|
||||||
(
|
(
|
||||||
!messageGroups && !lastMessage && messageIds
|
!messageGroups && !lastMessage && messageIds
|
||||||
|
|||||||
@ -700,7 +700,8 @@ export default memo(withGlobal<OwnProps>(
|
|||||||
&& !isMessageUnread
|
&& !isMessageUnread
|
||||||
&& readDateExpiresAt
|
&& readDateExpiresAt
|
||||||
&& message.date > Date.now() / 1000 - readDateExpiresAt
|
&& message.date > Date.now() / 1000 - readDateExpiresAt
|
||||||
&& !userStatus?.isReadDateRestricted,
|
&& !userStatus?.isReadDateRestricted
|
||||||
|
&& messageListType !== 'scheduled',
|
||||||
);
|
);
|
||||||
const shouldRenderShowWhen = Boolean(
|
const shouldRenderShowWhen = Boolean(
|
||||||
canLoadReadDate && isPrivate && selectUserStatus(global, chat.id)?.isReadDateRestrictedByMe,
|
canLoadReadDate && isPrivate && selectUserStatus(global, chat.id)?.isReadDateRestrictedByMe,
|
||||||
|
|||||||
@ -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;
|
return global;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user