Исправить скрытие разделителя новых DM

This commit is contained in:
AidarKC
2026-09-10 12:41:33 +03:00
parent 4c7e71f21f
commit d83f1d4cce
2 changed files with 9 additions and 8 deletions
+8 -7
View File
@@ -1355,6 +1355,14 @@ export function render({ navigate, route, chrome }) {
const finalText = editing
? `${String(editing?.prefixText || '')}${text}`
: `${replying ? buildDmReplyTechBlock({ baseKey: replying.baseKey }) : ''}${text}`;
// A new outgoing message immediately ends the visual "Новые сообщения" section.
// Do this before awaiting the server: the divider is a UI-session marker, not a
// delivery/read receipt indicator. Editing an existing message does not clear it.
if (!editing) {
hideUnreadSeparator({ rerender: false });
}
const tempId = editing ? '' : addOutgoingPendingMessage(chatId, text);
renderChatLog({ scrollMode: 'latest', markAsRead: false });
scrollToLatestMessageSmart(log, { smoothIfNearBottom: true });
@@ -1392,13 +1400,6 @@ export function render({ navigate, route, chrome }) {
deliveryState: result?.deliveryState || 'accepted',
});
// In a DM the "Новые сообщения" divider stays fixed for the current open
// chat session and disappears only after a successfully sent NEW message.
// Editing an existing message must not clear the divider.
if (!editing) {
hideUnreadSeparator({ rerender: false });
}
if (editing) {
cancelEditMode({ restoreDraft: true });
} else if (replying) {