Show operator presence near reply box

This commit is contained in:
rajchales-monito
2026-07-30 12:16:17 +02:00
parent 9a0f7dd224
commit deb090a882
3 changed files with 29 additions and 5 deletions
+9 -5
View File
@@ -1106,8 +1106,8 @@ function renderActive() {
}
function renderOperatorPresence() {
const box = $("#operatorPresence");
if (!box || !state.activeId) return;
const boxes = [$("#operatorPresence"), $("#replyOperatorPresence")].filter(Boolean);
if (!boxes.length || !state.activeId) return;
const operators = (state.operatorPresence[state.activeId] || [])
.filter((operator) => operator.username !== state.me?.username);
const typing = state.operatorTyping[state.activeId];
@@ -1118,9 +1118,13 @@ function renderOperatorPresence() {
if (typing && typing.username !== state.me?.username) {
parts.push(`${typing.name} pise...`);
}
box.textContent = parts.join(" · ");
box.classList.toggle("hidden", !parts.length);
box.classList.toggle("typing", Boolean(typing && typing.username !== state.me?.username));
const text = parts.join(" · ");
const isTyping = Boolean(typing && typing.username !== state.me?.username);
for (const box of boxes) {
box.textContent = text;
box.classList.toggle("hidden", !parts.length);
box.classList.toggle("typing", isTyping);
}
}
function flashOperatorTyping(data) {