Quick Preview: Fix Mark as Read for topics in Quick Preview (#6900)

This commit is contained in:
Alexander Zinchuk 2026-05-05 13:46:10 +02:00
parent 0a398bfb4e
commit a6a9efe602

View File

@ -1,4 +1,3 @@
import type { FC } from '@teact';
import { memo } from '@teact';
import { getActions, withGlobal } from '../../../global';
@ -45,7 +44,7 @@ type StateProps = {
const EMOJI_STATUS_SIZE = 22;
const QuickPreviewModalHeader: FC<OwnProps & StateProps> = ({
const QuickPreviewModalHeader = ({
chatId,
threadId,
chat,
@ -58,14 +57,19 @@ const QuickPreviewModalHeader: FC<OwnProps & StateProps> = ({
unreadCount,
hasUnreadMark,
onClose,
}) => {
}: OwnProps & StateProps) => {
const lang = useLang();
const { markChatMessagesRead } = getActions();
const { markChatMessagesRead, markTopicRead } = getActions();
const {
connectionStatusText,
} = useConnectionStatus(lang, connectionState, isSyncing || isFetchingDifference, true);
const handleMarkAsRead = useLastCallback(() => {
if (chat?.isForum && threadId !== undefined && threadId !== MAIN_THREAD_ID) {
markTopicRead({ chatId, topicId: Number(threadId) });
return;
}
markChatMessagesRead({ id: chatId });
});