mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 01:15:47 +01:00
18 lines
304 B
TypeScript
18 lines
304 B
TypeScript
export function loadSettings(path: string): Settings | null {
|
|
const item = localStorage.getItem(path);
|
|
if (!item) {
|
|
return null;
|
|
}
|
|
|
|
try {
|
|
return JSON.parse(item) as Settings;
|
|
} catch (e) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
export interface Settings {
|
|
searchUrl: string;
|
|
searchBar: boolean;
|
|
}
|