@webitel/ui-sdk 24.6.46 → 24.6.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
|
@@ -2,6 +2,7 @@ import { CallActions, ChatActions, JobState } from 'webitel-sdk';
|
|
|
2
2
|
import i18n from '../../../locale/i18n.js';
|
|
3
3
|
import BaseStoreModule from '../../../store/BaseStoreModules/BaseStoreModule.js';
|
|
4
4
|
import endChatSound from '../assets/audio/end-chat.wav';
|
|
5
|
+
import endCallSound from '../assets/audio/end-call.mp3';
|
|
5
6
|
import newChatSound from '../assets/audio/new-chat.wav';
|
|
6
7
|
import newMessageSound from '../assets/audio/new-message.wav';
|
|
7
8
|
import ringingSound from '../assets/audio/ringing.mp3';
|
|
@@ -19,10 +20,11 @@ const getNotificationSound = (action) => {
|
|
|
19
20
|
case ChatActions.Close:
|
|
20
21
|
return new Audio(endChatSound);
|
|
21
22
|
case CallActions.Ringing:
|
|
22
|
-
|
|
23
23
|
const audio = new Audio(ringingSound);
|
|
24
24
|
audio.loop = true;
|
|
25
25
|
return audio;
|
|
26
|
+
case CallActions.Hangup:
|
|
27
|
+
return new Audio(endCallSound);
|
|
26
28
|
default:
|
|
27
29
|
return false;
|
|
28
30
|
}
|
|
@@ -120,6 +122,10 @@ export default class NotificationsStoreModule extends BaseStoreModule {
|
|
|
120
122
|
if (context.getters.IS_SOUND_ALLOWED
|
|
121
123
|
&& !localStorage.getItem('wtIsPlaying')
|
|
122
124
|
) {
|
|
125
|
+
if (action === CallActions.Hangup
|
|
126
|
+
&& !localStorage.getItem('settings/callEndSound'))
|
|
127
|
+
return;
|
|
128
|
+
|
|
123
129
|
const audio = sound instanceof Audio ? sound : new Audio(sound);
|
|
124
130
|
audio.addEventListener('ended', () => {
|
|
125
131
|
context.dispatch('STOP_SOUND');
|