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/ee/server/startup/upsell.ts

22 lines
734 B

import { License } from '@rocket.chat/license';
import { Settings } from '@rocket.chat/models';
import { Meteor } from 'meteor/meteor';
import { notifyOnSettingChangedById } from '../../../app/lib/server/lib/notifyListener';
import { updateAuditedBySystem } from '../../../server/settings/lib/auditedSettingUpdates';
const handleHadTrial = (): void => {
if (License.getLicense()?.information.trial) {
void (async () => {
(
await updateAuditedBySystem({
reason: 'handleHadTrial',
})(Settings.updateValueById, 'Cloud_Workspace_Had_Trial', true)
).modifiedCount && void notifyOnSettingChangedById('Cloud_Workspace_Had_Trial');
})();
}
};
Meteor.startup(() => {
License.onValidateLicense(handleHadTrial);
});