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-utils/client/lib/AdminBox.js

25 lines
567 B

import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import _ from 'underscore';
export const AdminBox = new class {
constructor() {
this.options = new ReactiveVar([]);
}
addOption(option) {
return Tracker.nonreactive(() => {
const actual = this.options.get();
actual.push(option);
return this.options.set(actual);
});
}
getOptions() {
return _.filter(this.options.get(), function(option) {
if ((option.permissionGranted == null) || option.permissionGranted()) {
return true;
}
});
}
}();