diff --git a/.changeset/grumpy-points-deliver.md b/.changeset/grumpy-points-deliver.md new file mode 100644 index 0000000000000..167351ebef565 --- /dev/null +++ b/.changeset/grumpy-points-deliver.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/ui-contexts': patch +'@rocket.chat/meteor': patch +--- + +Adjusts custom sound loop on omnichannel continuous notification to play `New room` loop instead of `New message` loop diff --git a/apps/meteor/client/hooks/useOmnichannelContinuousSoundNotification.ts b/apps/meteor/client/hooks/useOmnichannelContinuousSoundNotification.ts index d565aa74902d8..ab09698094b63 100644 --- a/apps/meteor/client/hooks/useOmnichannelContinuousSoundNotification.ts +++ b/apps/meteor/client/hooks/useOmnichannelContinuousSoundNotification.ts @@ -19,7 +19,7 @@ export const useOmnichannelContinuousSoundNotification = (queue: T[]) => { return; } - notificationSounds.playNewMessageLoop(); + notificationSounds.playNewRoomLoop(); return () => { notificationSounds.stopNewRoom(); diff --git a/apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.tsx b/apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.tsx index e06dd7a354a19..be9606d2d3657 100644 --- a/apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.tsx +++ b/apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.tsx @@ -75,10 +75,10 @@ const CustomSoundProvider = ({ children }: CustomSoundProviderProps) => { const contextValue = useMemo(() => { const notificationSounds = { playNewRoom: () => play(newRoomNotification, { loop: false, volume: formatVolume(notificationsSoundVolume) }), + playNewRoomLoop: () => play(newRoomNotification, { loop: true, volume: formatVolume(notificationsSoundVolume) }), playNewMessage: () => play(newMessageNotification, { loop: false, volume: formatVolume(notificationsSoundVolume) }), playNewMessageCustom: (soundId: ICustomSound['_id']) => play(soundId, { loop: false, volume: formatVolume(notificationsSoundVolume) }), - playNewMessageLoop: () => play(newMessageNotification, { loop: true, volume: formatVolume(notificationsSoundVolume) }), stopNewRoom: () => stop(newRoomNotification), stopNewMessage: () => stop(newMessageNotification), }; diff --git a/packages/ui-contexts/src/CustomSoundContext.ts b/packages/ui-contexts/src/CustomSoundContext.ts index a1a0d84d9e69f..a8c7a64f844e0 100644 --- a/packages/ui-contexts/src/CustomSoundContext.ts +++ b/packages/ui-contexts/src/CustomSoundContext.ts @@ -30,8 +30,8 @@ export type CustomSoundContextValue = { }; notificationSounds: { playNewRoom: () => void; + playNewRoomLoop: () => void; playNewMessage: () => void; - playNewMessageLoop: () => void; stopNewRoom: () => void; stopNewMessage: () => void; playNewMessageCustom: (soundId: ICustomSound['_id']) => void; @@ -60,8 +60,8 @@ export const CustomSoundContext = createContext({ }, notificationSounds: { playNewRoom: () => undefined, + playNewRoomLoop: () => undefined, playNewMessage: () => undefined, - playNewMessageLoop: () => undefined, stopNewRoom: () => undefined, stopNewMessage: () => undefined, playNewMessageCustom: () => undefined,