Reduce notifyUser propagation (#17088)

pull/17090/head
Rodrigo Nascimento 5 years ago committed by Diego Sampaio
parent 3e24ae2636
commit fd7eb4b06f
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 6
      app/lib/server/startup/userDataStream.js
  2. 2
      app/livechat/server/lib/stream/departmentAgents.js

@ -4,13 +4,13 @@ import { Notifications } from '../../../notifications/server';
Users.on('change', ({ clientAction, id, data, diff }) => {
switch (clientAction) {
case 'updated':
Notifications.notifyUser(id, 'userData', { diff, type: clientAction });
Notifications.notifyUserInThisInstance(id, 'userData', { diff, type: clientAction });
break;
case 'inserted':
Notifications.notifyUser(id, 'userData', { data, type: clientAction });
Notifications.notifyUserInThisInstance(id, 'userData', { data, type: clientAction });
break;
case 'removed':
Notifications.notifyUser(id, 'userData', { id, type: clientAction });
Notifications.notifyUserInThisInstance(id, 'userData', { id, type: clientAction });
break;
}
});

@ -9,7 +9,7 @@ const emitNotification = (action, payload = {}) => {
return;
}
Notifications.notifyUser(agentId, 'departmentAgentData', {
Notifications.notifyUserInThisInstance(agentId, 'departmentAgentData', {
action,
...payload,
});

Loading…
Cancel
Save