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/ee/app/license/client/index.ts

22 lines
565 B

import { fetchFeatures } from '../../../client/lib/fetchFeatures';
import { queryClient } from '../../../../client/lib/queryClient';
const allModules = queryClient
.fetchQuery({
queryKey: ['ee.features'],
queryFn: fetchFeatures,
})
.then((features) => new Set<string>(features))
.catch((e) => {
console.error('Error getting modules', e);
return Promise.reject(e);
});
export async function hasLicense(feature: string): Promise<boolean> {
try {
const features = await allModules;
return features.has(feature);
} catch (e) {
return false;
}
}