Files
Homarr/tools/settings.ts
Thomas "ajnart" Camlong 1bd7694b52 Move types
2022-05-01 14:46:26 +02:00

15 lines
267 B
TypeScript

import { Settings } from './types';
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;
}
}