fix: Audio notification instance not updating in realtime

This commit is contained in:
iamsivin
2024-06-12 18:01:56 +05:30
parent 650fee58a6
commit dcbb045bcd
4 changed files with 33 additions and 26 deletions
@@ -36,6 +36,18 @@ class DashboardAudioNotificationHelper {
initFaviconSwitcher();
};
updateInstanceValues = ({
alwaysPlayAudioAlert,
alertIfUnreadConversationExist,
audioAlertType,
audioAlertTone,
}) => {
this.audioAlertType = audioAlertType;
this.playAlertOnlyWhenHidden = !alwaysPlayAudioAlert;
this.alertIfUnreadConversationExist = alertIfUnreadConversationExist;
this.audioAlertTone = 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 || {};