mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-18 20:15:10 +00:00
chore: Prevent online presence during impersonation (#11538)
This commit is contained in:
@@ -3,6 +3,9 @@ import BaseActionCableConnector from '../../shared/helpers/BaseActionCableConnec
|
|||||||
import DashboardAudioNotificationHelper from './AudioAlerts/DashboardAudioNotificationHelper';
|
import DashboardAudioNotificationHelper from './AudioAlerts/DashboardAudioNotificationHelper';
|
||||||
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
import { BUS_EVENTS } from 'shared/constants/busEvents';
|
||||||
import { emitter } from 'shared/helpers/mitt';
|
import { emitter } from 'shared/helpers/mitt';
|
||||||
|
import { useImpersonation } from 'dashboard/composables/useImpersonation';
|
||||||
|
|
||||||
|
const { isImpersonating } = useImpersonation();
|
||||||
|
|
||||||
class ActionCableConnector extends BaseActionCableConnector {
|
class ActionCableConnector extends BaseActionCableConnector {
|
||||||
constructor(app, pubsubToken) {
|
constructor(app, pubsubToken) {
|
||||||
@@ -52,6 +55,7 @@ class ActionCableConnector extends BaseActionCableConnector {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onPresenceUpdate = data => {
|
onPresenceUpdate = data => {
|
||||||
|
if (isImpersonating.value) return;
|
||||||
this.app.$store.dispatch('contacts/updatePresence', data.contacts);
|
this.app.$store.dispatch('contacts/updatePresence', data.contacts);
|
||||||
this.app.$store.dispatch('agents/updatePresence', data.users);
|
this.app.$store.dispatch('agents/updatePresence', data.users);
|
||||||
this.app.$store.dispatch('setCurrentUserAvailability', data.users);
|
this.app.$store.dispatch('setCurrentUserAvailability', data.users);
|
||||||
|
|||||||
Reference in New Issue
Block a user