mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2024-04-21 12:32:08 +00:00
16 lines
399 B
JavaScript
16 lines
399 B
JavaScript
const settings = JSON.parse(window.localStorage.getItem("settings") || "null") || {};
|
|
|
|
export function settings_get(key) {
|
|
if (settings[key] === undefined) {
|
|
return null;
|
|
}
|
|
return settings[key];
|
|
}
|
|
|
|
export function settings_put(key, value) {
|
|
settings[key] = value;
|
|
setTimeout(() => {
|
|
window.localStorage.setItem("settings", JSON.stringify(settings));
|
|
}, 0);
|
|
}
|