Quick Preview: Fix Mark as Read for topics in Quick Preview (#6900)
This commit is contained in:
parent
0a398bfb4e
commit
a6a9efe602
@ -1,4 +1,3 @@
|
|||||||
import type { FC } from '@teact';
|
|
||||||
import { memo } from '@teact';
|
import { memo } from '@teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
|
|
||||||
@ -45,7 +44,7 @@ type StateProps = {
|
|||||||
|
|
||||||
const EMOJI_STATUS_SIZE = 22;
|
const EMOJI_STATUS_SIZE = 22;
|
||||||
|
|
||||||
const QuickPreviewModalHeader: FC<OwnProps & StateProps> = ({
|
const QuickPreviewModalHeader = ({
|
||||||
chatId,
|
chatId,
|
||||||
threadId,
|
threadId,
|
||||||
chat,
|
chat,
|
||||||
@ -58,14 +57,19 @@ const QuickPreviewModalHeader: FC<OwnProps & StateProps> = ({
|
|||||||
unreadCount,
|
unreadCount,
|
||||||
hasUnreadMark,
|
hasUnreadMark,
|
||||||
onClose,
|
onClose,
|
||||||
}) => {
|
}: OwnProps & StateProps) => {
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const { markChatMessagesRead } = getActions();
|
const { markChatMessagesRead, markTopicRead } = getActions();
|
||||||
const {
|
const {
|
||||||
connectionStatusText,
|
connectionStatusText,
|
||||||
} = useConnectionStatus(lang, connectionState, isSyncing || isFetchingDifference, true);
|
} = useConnectionStatus(lang, connectionState, isSyncing || isFetchingDifference, true);
|
||||||
|
|
||||||
const handleMarkAsRead = useLastCallback(() => {
|
const handleMarkAsRead = useLastCallback(() => {
|
||||||
|
if (chat?.isForum && threadId !== undefined && threadId !== MAIN_THREAD_ID) {
|
||||||
|
markTopicRead({ chatId, topicId: Number(threadId) });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
markChatMessagesRead({ id: chatId });
|
markChatMessagesRead({ id: chatId });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user