Add notification sound.

This commit is contained in:
天クマ 2026-07-14 20:28:16 -03:00
commit 3ba0f9792c
3 changed files with 2 additions and 0 deletions

2
app.js
View file

@ -7,6 +7,7 @@ import { compensateMessageOrdering, formatTime } from "./utils.js";
let chatsState = [];
let activeChatState = null;
let userInfo;
const messageTone = new Audio("./message.ogg");
// Initialize app when DOM is ready
document.addEventListener('DOMContentLoaded', async () => {
@ -123,6 +124,7 @@ function handleIncomingMessage(msg) {
}
// console.log('[WS] Resolved msgChatId:', msgChatId, '| activeChatState:', activeChatState?.id);
messageTone.play();
if (activeChatState && activeChatState.id === msgChatId) {
const msgId = normalizeChatId(msg.id) || msg.id;