Compare commits

...
Author SHA1 Message Date
Muhsin KelothandGitHub d44509a413 Merge branch 'develop' into fix/CW-3385 2024-08-27 13:53:25 +05:30
Sivin VargheseandGitHub 774202e462 Merge branch 'develop' into fix/CW-3385 2024-08-27 13:29:56 +05:30
Sivin VargheseandGitHub 37979b89a6 Merge branch 'develop' into fix/CW-3385 2024-08-27 08:40:50 +05:30
Sivin VargheseandGitHub d57d302446 Merge branch 'develop' into fix/CW-3385 2024-08-26 12:30:42 +05:30
Sivin VargheseandGitHub 57760bba20 Merge branch 'develop' into fix/CW-3385 2024-08-23 09:24:47 +05:30
Sivin VargheseandGitHub b221987b2b Merge branch 'develop' into fix/CW-3385 2024-08-22 16:43:23 +05:30
Sivin VargheseandGitHub 26dd040123 Merge branch 'develop' into fix/CW-3385 2024-08-22 09:02:51 +05:30
Sivin VargheseandGitHub 00a5ea5178 Merge branch 'develop' into fix/CW-3385 2024-08-20 12:06:17 +05:30
Sivin VargheseandGitHub 43adbe5743 Merge branch 'develop' into fix/CW-3385 2024-08-14 13:52:32 +05:30
Sivin VargheseandGitHub 3da2ce6e6a Merge branch 'develop' into fix/CW-3385 2024-08-13 15:19:04 +05:30
Muhsin KelothandGitHub 383bccbee8 Merge branch 'develop' into fix/CW-3385 2024-08-13 12:45:46 +05:30
Sivin VargheseandGitHub be2e75ffb5 Merge branch 'develop' into fix/CW-3385 2024-08-09 19:09:43 +05:30
iamsivin 88cb3fc76a chore: Clean up 2024-08-08 19:50:21 +05:30
Sivin VargheseandGitHub e09fceffc9 Merge branch 'develop' into fix/CW-3385 2024-08-08 19:42:17 +05:30
Sivin VargheseandGitHub 4b511da098 Merge branch 'develop' into fix/CW-3385 2024-06-14 09:15:37 +05:30
iamsivin 2d8a759655 chore: Clean up 2024-06-13 14:18:12 +05:30
iamsivin c1cc921425 chore: Minor fix 2024-06-13 14:08:52 +05:30
iamsivin dcbb045bcd fix: Audio notification instance not updating in realtime 2024-06-12 18:01:56 +05:30
3 changed files with 44 additions and 8 deletions
@@ -36,6 +36,22 @@ class DashboardAudioNotificationHelper {
initFaviconSwitcher();
};
updateInstanceValues = ({
alwaysPlayAudioAlert,
alertIfUnreadConversationExist,
audioAlertType,
audioAlertTone,
}) => {
this.audioAlertType = audioAlertType;
this.playAlertOnlyWhenHidden = !alwaysPlayAudioAlert;
this.alertIfUnreadConversationExist = alertIfUnreadConversationExist;
this.audioAlertTone = audioAlertTone;
getAlertAudio('', {
type: 'dashboard',
alertTone: this.audioAlertTone,
});
};
onAudioListenEvent = async () => {
try {
await getAlertAudio('', {
@@ -21,7 +21,7 @@ const initializeAudioAlerts = user => {
enable_audio_alerts: audioAlertType,
alert_if_unread_assigned_conversation_exist: alertIfUnreadConversationExist,
notification_tone: audioAlertTone,
// UI Settings can be undefined initally as we don't send the
// UI Settings can be undefined initially as we don't send the
// entire payload for the user during the signup process.
} = uiSettings || {};
@@ -4,6 +4,7 @@ import { useUISettings } from 'dashboard/composables/useUISettings';
import AudioAlertTone from './AudioAlertTone.vue';
import AudioAlertEvent from './AudioAlertEvent.vue';
import AudioAlertCondition from './AudioAlertCondition.vue';
import DashboardAudioNotificationHelper from 'dashboard/helper/AudioAlerts/DashboardAudioNotificationHelper';
export default {
components: {
@@ -38,6 +39,21 @@ export default {
this.$store.dispatch('userNotificationSettings/get');
},
methods: {
updateAudioAlertInstanceValues() {
const {
enable_audio_alerts: audioAlert = '',
always_play_audio_alert: alwaysPlayAudioAlert,
alert_if_unread_assigned_conversation_exist:
alertIfUnreadConversationExist,
notification_tone: alertTone,
} = this.uiSettings;
DashboardAudioNotificationHelper.updateInstanceValues({
audioAlertType: audioAlert,
alwaysPlayAudioAlert: alwaysPlayAudioAlert,
alertIfUnreadConversationExist: alertIfUnreadConversationExist,
audioAlertTone: alertTone,
});
},
notificationUISettings(uiSettings) {
const {
enable_audio_alerts: audioAlert = '',
@@ -69,27 +85,31 @@ export default {
];
this.alertTone = alertTone || 'ding';
},
handAudioAlertChange(value) {
async handAudioAlertChange(value) {
this.audioAlert = value;
this.updateUISettings({
await this.updateUISettings({
enable_audio_alerts: this.audioAlert,
});
this.updateAudioAlertInstanceValues();
useAlert(this.$t('PROFILE_SETTINGS.FORM.API.UPDATE_SUCCESS'));
},
handleAudioAlertConditions(id, value) {
async handleAudioAlertConditions(id, value) {
if (id === 'tab_is_inactive') {
this.updateUISettings({
await this.updateUISettings({
always_play_audio_alert: !value,
});
this.updateAudioAlertInstanceValues();
} else if (id === 'conversations_are_read') {
this.updateUISettings({
await this.updateUISettings({
alert_if_unread_assigned_conversation_exist: value,
});
this.updateAudioAlertInstanceValues();
}
useAlert(this.$t('PROFILE_SETTINGS.FORM.API.UPDATE_SUCCESS'));
},
handleAudioToneChange(value) {
this.updateUISettings({ notification_tone: value });
async handleAudioToneChange(value) {
await this.updateUISettings({ notification_tone: value });
this.updateAudioAlertInstanceValues();
useAlert(this.$t('PROFILE_SETTINGS.FORM.API.UPDATE_SUCCESS'));
},
},