mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
feat: update notification settings (#10529)
https://github.com/user-attachments/assets/52ecf3f8-0329-4268-906e-d6102338f4af --------- Co-authored-by: Pranav <pranav@chatwoot.com> Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
import {
|
||||
ANALYTICS_IDENTITY,
|
||||
CHATWOOT_RESET,
|
||||
CHATWOOT_SET_USER,
|
||||
} from '../constants/appEvents';
|
||||
import AnalyticsHelper from './AnalyticsHelper';
|
||||
import DashboardAudioNotificationHelper from './AudioAlerts/DashboardAudioNotificationHelper';
|
||||
import { emitter } from 'shared/helpers/mitt';
|
||||
|
||||
export const CHATWOOT_SET_USER = 'CHATWOOT_SET_USER';
|
||||
export const CHATWOOT_RESET = 'CHATWOOT_RESET';
|
||||
|
||||
export const ANALYTICS_IDENTITY = 'ANALYTICS_IDENTITY';
|
||||
export const ANALYTICS_RESET = 'ANALYTICS_RESET';
|
||||
|
||||
export const initializeAnalyticsEvents = () => {
|
||||
emitter.on(ANALYTICS_IDENTITY, ({ user }) => {
|
||||
AnalyticsHelper.identify(user);
|
||||
});
|
||||
};
|
||||
|
||||
const initializeAudioAlerts = user => {
|
||||
export const initializeAudioAlerts = user => {
|
||||
const { ui_settings: uiSettings } = user || {};
|
||||
const {
|
||||
always_play_audio_alert: alwaysPlayAudioAlert,
|
||||
@@ -25,7 +24,7 @@ const initializeAudioAlerts = user => {
|
||||
// entire payload for the user during the signup process.
|
||||
} = uiSettings || {};
|
||||
|
||||
DashboardAudioNotificationHelper.setInstanceValues({
|
||||
DashboardAudioNotificationHelper.set({
|
||||
currentUser: user,
|
||||
audioAlertType: audioAlertType || 'none',
|
||||
audioAlertTone: audioAlertTone || 'ding',
|
||||
|
||||
Reference in New Issue
Block a user