diff --git a/web/index.html b/web/index.html index d1314d1..f83c850 100644 --- a/web/index.html +++ b/web/index.html @@ -2,7 +2,7 @@
- + @@ -11,5 +11,6 @@ + diff --git a/web/public/sounds/bright.flac b/web/public/sounds/bright.flac new file mode 100644 index 0000000..e831eb9 Binary files /dev/null and b/web/public/sounds/bright.flac differ diff --git a/web/public/sounds/descending.flac b/web/public/sounds/descending.flac new file mode 100644 index 0000000..2a4b4a8 Binary files /dev/null and b/web/public/sounds/descending.flac differ diff --git a/web/src/api/statestore/main.ts b/web/src/api/statestore/main.ts index a79d5ba..d2453c4 100644 --- a/web/src/api/statestore/main.ts +++ b/web/src/api/statestore/main.ts @@ -298,6 +298,9 @@ export class StateStore { const roomName = room.meta.current.name ?? "Unnamed room" const senderName = memberEvt?.content.displayname ?? evt.sender const title = senderName === roomName ? senderName : `${senderName} (${roomName})` + if (sound) { + (document.getElementById("default-notification-sound") as HTMLAudioElement)?.play() + } const notif = new Notification(title, { body, icon, @@ -309,9 +312,6 @@ export class StateStore { room.openNotifications.set(rowid, notif) notif.onclose = () => room.openNotifications.delete(rowid) notif.onclick = () => this.onClickNotification(room.roomID) - if (sound) { - // TODO play sound - } } onClickNotification(roomID: RoomID) {