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/client/hooks/useHasLicense.js

18 lines
389 B

import { useState, useEffect } from 'react';
import { hasLicense } from '../../app/license/client';
export const useHasLicense = (licenseName) => {
const [license, setLicense] = useState('loading');
useEffect(() => {
hasLicense(licenseName).then((enabled) => {
if (enabled) {
return setLicense(true);
}
setLicense(false);
});
}, [licenseName]);
return license;
};