Frontend fixes.

This commit is contained in:
2026-03-28 12:34:43 -04:00
parent 3160d96c15
commit 8de7ecf0ff
2 changed files with 8 additions and 3 deletions

View File

@@ -59,7 +59,6 @@ button:active {
.msg { .msg {
margin-bottom: 2px; margin-bottom: 2px;
display: inline-flexbox;
flex-direction: row; flex-direction: row;
align-items: stretch; align-items: stretch;
justify-content: flex-start; justify-content: flex-start;

View File

@@ -73,6 +73,7 @@ export function initWebSocket(
usersListEl.innerHTML = groups.length usersListEl.innerHTML = groups.length
? "Online: " + groups.join(", ") ? "Online: " + groups.join(", ")
: "Online: ?"; : "Online: ?";
renderChat(chatEl, inputContainer);
break; break;
} }
case "join_evt": { case "join_evt": {
@@ -85,6 +86,7 @@ export function initWebSocket(
); );
const groups = getGroupedUsers(); const groups = getGroupedUsers();
usersListEl.innerHTML = "Online: " + groups.join(", "); usersListEl.innerHTML = "Online: " + groups.join(", ");
renderChat(chatEl, inputContainer);
break; break;
} }
case "leave_evt": { case "leave_evt": {
@@ -98,6 +100,7 @@ export function initWebSocket(
removeUser(sid); removeUser(sid);
const groups = getGroupedUsers(); const groups = getGroupedUsers();
usersListEl.innerHTML = "Online: " + groups.join(", "); usersListEl.innerHTML = "Online: " + groups.join(", ");
renderChat(chatEl, inputContainer);
break; break;
} }
case "name_evt": { case "name_evt": {
@@ -112,6 +115,7 @@ export function initWebSocket(
); );
const groups = getGroupedUsers(); const groups = getGroupedUsers();
usersListEl.innerHTML = "Online: " + groups.join(", "); usersListEl.innerHTML = "Online: " + groups.join(", ");
renderChat(chatEl, inputContainer);
break; break;
} }
case "msg_evt": { case "msg_evt": {
@@ -148,6 +152,7 @@ export function initWebSocket(
notifyDirectReply(username, content); notifyDirectReply(username, content);
} }
} }
renderChat(chatEl, inputContainer);
break; break;
} }
case "msg_ack": { case "msg_ack": {
@@ -164,6 +169,7 @@ export function initWebSocket(
setReplyTo(sid); setReplyTo(sid);
} }
} }
renderChat(chatEl, inputContainer);
break; break;
} }
case "name_ack": { case "name_ack": {
@@ -173,6 +179,7 @@ export function initWebSocket(
`<span class="err">Name change failed: ${new Option(status).innerHTML}</span>`, `<span class="err">Name change failed: ${new Option(status).innerHTML}</span>`,
); );
} }
renderChat(chatEl, inputContainer);
break; break;
} }
case "ping": { case "ping": {
@@ -182,9 +189,8 @@ export function initWebSocket(
} }
default: default:
console.warn("Unknown packet type:", packet.type); console.warn("Unknown packet type:", packet.type);
renderChat(chatEl, inputContainer);
} }
renderChat(chatEl, inputContainer);
}; };
socket.onerror = (err) => { socket.onerror = (err) => {