наверное работает

This commit is contained in:
AidarKC
2026-04-21 01:04:05 +03:00
parent 2d48ae7a16
commit 185ba5b1d3
12 changed files with 186 additions and 34 deletions
+10 -5
View File
@@ -7,6 +7,7 @@ import {
getChatMessages,
markChatRead,
markOutgoingSent,
markReadReceiptSentByBaseKey,
authService,
state,
} from '../state.js';
@@ -33,10 +34,10 @@ function renderLog(list, chatId) {
messages.forEach((msg) => {
if (!unreadSeparatorInserted && msg?.from === 'in' && msg?.unread) {
const sep = document.createElement('div');
sep.className = 'meta-muted';
sep.style.textAlign = 'center';
sep.style.margin = '8px 0';
sep.textContent = 'Новые сообщения';
sep.className = 'chat-unread-separator';
const label = document.createElement('span');
label.textContent = 'Новые сообщения';
sep.append(label);
list.append(sep);
unreadSeparatorInserted = true;
}
@@ -216,7 +217,11 @@ async function sendReadReceiptsForVisible(chatId) {
refNonce: ref.nonce,
refType: 1,
});
row.readReceiptSent = true;
if (row.baseKey) {
markReadReceiptSentByBaseKey(row.baseKey);
} else {
row.readReceiptSent = true;
}
} catch (e) {
addAppLogEntry({
level: 'warn',