mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-08 07:39:23 +01:00
15 lines
267 B
TypeScript
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;
|
|
}
|
|
}
|