Add new config format

Should be WAAAAY easier to work with modules now
This commit is contained in:
ajnart
2022-05-22 20:42:10 +02:00
parent bf85818f8b
commit af2e0235bf
12 changed files with 99 additions and 65 deletions

View File

@@ -19,8 +19,9 @@ export default function PingComponent(props: any) {
const { url }: { url: string } = props;
const [isOnline, setOnline] = useState<State>('loading');
const exists = config.modules?.[PingModule.title]?.enabled ?? false;
useEffect(() => {
if (!config.settings.enabledModules.includes('Ping Services')) {
if (!exists) {
return;
}
axios
@@ -32,7 +33,7 @@ export default function PingComponent(props: any) {
setOnline('down');
});
}, []);
if (!config.settings.enabledModules.includes('Ping Services')) {
if (!exists) {
return null;
}
return (