SHA256
UI: исправить автообновление и хронологию диалогов; обновить деплой-цели
This commit is contained in:
@@ -68,6 +68,17 @@ function resolveDeliveryStatus(msg) {
|
||||
return '…';
|
||||
}
|
||||
|
||||
function scrollToLatestMessage(list) {
|
||||
if (!list) return;
|
||||
const apply = () => {
|
||||
list.scrollTop = list.scrollHeight;
|
||||
};
|
||||
apply();
|
||||
window.requestAnimationFrame(apply);
|
||||
window.setTimeout(apply, 0);
|
||||
window.setTimeout(apply, 120);
|
||||
}
|
||||
|
||||
function renderLog(list, chatId) {
|
||||
list.innerHTML = '';
|
||||
const messages = getChatMessages(chatId);
|
||||
@@ -110,7 +121,7 @@ function renderLog(list, chatId) {
|
||||
bubble.append(textNode, metaNode);
|
||||
list.append(bubble);
|
||||
});
|
||||
list.scrollTop = list.scrollHeight;
|
||||
scrollToLatestMessage(list);
|
||||
markChatRead(chatId);
|
||||
}
|
||||
|
||||
@@ -240,10 +251,11 @@ export function render({ navigate, route }) {
|
||||
}
|
||||
});
|
||||
|
||||
renderLog(log, chatId);
|
||||
void sendReadReceiptsForVisible(chatId);
|
||||
wrap.append(log, form);
|
||||
screen.append(wrap);
|
||||
renderLog(log, chatId);
|
||||
window.requestAnimationFrame(() => scrollToLatestMessage(log));
|
||||
void sendReadReceiptsForVisible(chatId);
|
||||
return screen;
|
||||
}
|
||||
async function sendReadReceiptsForVisible(chatId) {
|
||||
|
||||
Reference in New Issue
Block a user