mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 23:45:48 +01:00
17 lines
294 B
TypeScript
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,
|
|
} |