Context Menu: Fix showing the read status (#5366)

This commit is contained in:
Alexander Zinchuk 2024-12-29 11:59:01 +01:00
parent 4cd8da212c
commit d0d7f307cc

View File

@ -44,6 +44,7 @@ import {
import { import {
selectActiveDownloads, selectActiveDownloads,
selectAllowedMessageActionsSlow, selectAllowedMessageActionsSlow,
selectBot,
selectCanForwardMessage, selectCanForwardMessage,
selectCanPlayAnimatedEmojis, selectCanPlayAnimatedEmojis,
selectCanScheduleUntilOnline, selectCanScheduleUntilOnline,
@ -747,10 +748,13 @@ export default memo(withGlobal<OwnProps>(
const userStatus = isPrivate ? selectUserStatus(global, chat.id) : undefined; const userStatus = isPrivate ? selectUserStatus(global, chat.id) : undefined;
const isOwn = isOwnMessage(message); const isOwn = isOwnMessage(message);
const chatBot = chat && selectBot(global, chat.id);
const isBot = Boolean(chatBot);
const isMessageUnread = selectIsMessageUnread(global, message); const isMessageUnread = selectIsMessageUnread(global, message);
const canLoadReadDate = Boolean( const canLoadReadDate = Boolean(
isPrivate isPrivate
&& isOwn && isOwn
&& !isBot
&& !isMessageUnread && !isMessageUnread
&& readDateExpiresAt && readDateExpiresAt
&& message.date > Date.now() / 1000 - readDateExpiresAt && message.date > Date.now() / 1000 - readDateExpiresAt