mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-06 13:35:48 +01:00
16 lines
273 B
TypeScript
16 lines
273 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 {
|
||
|
|
searchBar: boolean,
|
||
|
|
}
|