Files
Homarr/tools/config.ts
2022-04-27 20:10:51 +02:00

17 lines
294 B
TypeScript

export function loadConfig(path: string): Config | null {
const item = localStorage.getItem(path);
if (!item) {
return null;
}
try {
return JSON.parse(item) as Config;
} catch (e) {
return null;
}
}
export interface Config {
searchUrl: string;
searchBar: boolean,
}