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/apps/meteor/client/lib/settings/PrivateSettingsCachedCollec...

28 lines
805 B

import type { ISetting } from '@rocket.chat/core-typings';
import { Notifications } from '../../../app/notifications/client';
import { CachedCollection } from '../../../app/ui-cached-collection/client';
class PrivateSettingsCachedCollection extends CachedCollection<ISetting> {
constructor() {
super({
name: 'private-settings',
eventType: 'onLogged',
});
}
async setupListener(): Promise<void> {
Notifications.onLogged(this.eventName as 'private-settings-changed', async (t: string, { _id, ...record }: { _id: string }) => {
this.log('record received', t, { _id, ...record });
this.collection.upsert({ _id }, record);
this.sync();
});
}
}
const instance = new PrivateSettingsCachedCollection();
export {
/** @deprecated */
instance as PrivateSettingsCachedCollection,
};