Skip to content

Commit a25e88c

Browse files
fix: wrong sound on Omnichannel continuous notification (RocketChat#37042)
1 parent d8270d8 commit a25e88c

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rocket.chat/ui-contexts': patch
3+
'@rocket.chat/meteor': patch
4+
---
5+
6+
Adjusts custom sound loop on omnichannel continuous notification to play `New room` loop instead of `New message` loop

apps/meteor/client/hooks/useOmnichannelContinuousSoundNotification.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const useOmnichannelContinuousSoundNotification = <T>(queue: T[]) => {
1919
return;
2020
}
2121

22-
notificationSounds.playNewMessageLoop();
22+
notificationSounds.playNewRoomLoop();
2323

2424
return () => {
2525
notificationSounds.stopNewRoom();

apps/meteor/client/providers/CustomSoundProvider/CustomSoundProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ const CustomSoundProvider = ({ children }: CustomSoundProviderProps) => {
7575
const contextValue = useMemo(() => {
7676
const notificationSounds = {
7777
playNewRoom: () => play(newRoomNotification, { loop: false, volume: formatVolume(notificationsSoundVolume) }),
78+
playNewRoomLoop: () => play(newRoomNotification, { loop: true, volume: formatVolume(notificationsSoundVolume) }),
7879
playNewMessage: () => play(newMessageNotification, { loop: false, volume: formatVolume(notificationsSoundVolume) }),
7980
playNewMessageCustom: (soundId: ICustomSound['_id']) =>
8081
play(soundId, { loop: false, volume: formatVolume(notificationsSoundVolume) }),
81-
playNewMessageLoop: () => play(newMessageNotification, { loop: true, volume: formatVolume(notificationsSoundVolume) }),
8282
stopNewRoom: () => stop(newRoomNotification),
8383
stopNewMessage: () => stop(newMessageNotification),
8484
};

packages/ui-contexts/src/CustomSoundContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export type CustomSoundContextValue = {
3030
};
3131
notificationSounds: {
3232
playNewRoom: () => void;
33+
playNewRoomLoop: () => void;
3334
playNewMessage: () => void;
34-
playNewMessageLoop: () => void;
3535
stopNewRoom: () => void;
3636
stopNewMessage: () => void;
3737
playNewMessageCustom: (soundId: ICustomSound['_id']) => void;
@@ -60,8 +60,8 @@ export const CustomSoundContext = createContext<CustomSoundContextValue>({
6060
},
6161
notificationSounds: {
6262
playNewRoom: () => undefined,
63+
playNewRoomLoop: () => undefined,
6364
playNewMessage: () => undefined,
64-
playNewMessageLoop: () => undefined,
6565
stopNewRoom: () => undefined,
6666
stopNewMessage: () => undefined,
6767
playNewMessageCustom: () => undefined,

0 commit comments

Comments
 (0)