The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/ui-admin/client/SettingsCachedCollection.js

20 lines
677 B

import { CachedCollection } from '../../ui-cached-collection';
import { Notifications } from '../../notifications/client';
export class PrivateSettingsCachedCollection extends CachedCollection {
constructor() {
super({
name: 'private-settings',
eventType: 'onLogged',
});
}
async setupListener(eventType, eventName) {
// private settings also need to listen to a change of authorizations for the setting-based authorizations
Notifications[eventType || this.eventType](eventName || this.eventName, async (t, { _id, ...record }) => {
this.log('record received', t, { _id, ...record });
this.collection.upsert({ _id }, record);
this.sync();
});
}
}