Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

✨(frontend) add sound notification for unread messages

lebaudantoine19804d2e3f94
diff --git a/src/frontend/src/features/notifications/MainNotificationToast.tsx b/src/frontend/src/features/notifications/MainNotificationToast.tsx
index 88b01337..4bddf3c3 100644
--- a/src/frontend/src/features/notifications/MainNotificationToast.tsx
+++ b/src/frontend/src/features/notifications/MainNotificationToast.tsx
@@ -30,6 +30,7 @@ export const MainNotificationToast = () => {
participant?: Participant | undefined
) => {
if (!participant || participant.isLocal) return
+ triggerNotificationSound(NotificationType.MessageReceived)
toastQueue.add(
{
participant: participant,
@@ -43,7 +44,7 @@ export const MainNotificationToast = () => {
return () => {
room.off(RoomEvent.ChatMessage, handleChatMessage)
}
- }, [room])
+ }, [room, triggerNotificationSound])
useEffect(() => {
const handleDataReceived = (
diff --git a/src/frontend/src/stores/notifications.ts b/src/frontend/src/stores/notifications.ts
index a717d01e..4416d004 100644
--- a/src/frontend/src/stores/notifications.ts
+++ b/src/frontend/src/stores/notifications.ts
@@ -14,6 +14,7 @@ const DEFAULT_STATE: State = {
new Map([
[NotificationType.ParticipantJoined, true],
[NotificationType.HandRaised, true],
+ [NotificationType.MessageReceived, true],
])
),
soundNotificationVolume: 0.1,