✨(frontend) add sound notification for unread messages
Add togglable audio alerts when new chat messages arrive, allowing users to customize their notification preferences.
This commit is contained in:
committed by
aleb_the_flash
parent
a979f05549
commit
19804d2e3f
@@ -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 = (
|
||||
|
||||
@@ -14,6 +14,7 @@ const DEFAULT_STATE: State = {
|
||||
new Map([
|
||||
[NotificationType.ParticipantJoined, true],
|
||||
[NotificationType.HandRaised, true],
|
||||
[NotificationType.MessageReceived, true],
|
||||
])
|
||||
),
|
||||
soundNotificationVolume: 0.1,
|
||||
|
||||
Reference in New Issue
Block a user