Add notification sound.
This commit is contained in:
parent
fe86db2987
commit
3ba0f9792c
3 changed files with 2 additions and 0 deletions
2
app.js
2
app.js
|
|
@ -7,6 +7,7 @@ import { compensateMessageOrdering, formatTime } from "./utils.js";
|
||||||
let chatsState = [];
|
let chatsState = [];
|
||||||
let activeChatState = null;
|
let activeChatState = null;
|
||||||
let userInfo;
|
let userInfo;
|
||||||
|
const messageTone = new Audio("./message.ogg");
|
||||||
|
|
||||||
// Initialize app when DOM is ready
|
// Initialize app when DOM is ready
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
|
@ -123,6 +124,7 @@ function handleIncomingMessage(msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('[WS] Resolved msgChatId:', msgChatId, '| activeChatState:', activeChatState?.id);
|
// console.log('[WS] Resolved msgChatId:', msgChatId, '| activeChatState:', activeChatState?.id);
|
||||||
|
messageTone.play();
|
||||||
|
|
||||||
if (activeChatState && activeChatState.id === msgChatId) {
|
if (activeChatState && activeChatState.id === msgChatId) {
|
||||||
const msgId = normalizeChatId(msg.id) || msg.id;
|
const msgId = normalizeChatId(msg.id) || msg.id;
|
||||||
|
|
|
||||||
BIN
message-long.ogg
Normal file
BIN
message-long.ogg
Normal file
Binary file not shown.
BIN
message.ogg
Normal file
BIN
message.ogg
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue