Files
filestash/public/assets/lib/settings.js
MickaelK 71b14e6eaf feature (3d): embed 3d viewer anywhere
This contains a bunch of things packaged in 1:

1) UI improvements for the 3D viewer to support all sort of file types
   and create a nice rendering in a clean way with all sort of options

2) enable people to use Filestash as an SDK so we can embed the 3d viewer
   elsewhere
2024-12-23 18:50:23 +11:00

16 lines
410 B
JavaScript

const settings = JSON.parse(window.localStorage.getItem("settings") || "null") || {};
export function settings_get(key, def = null) {
if (settings[key] === undefined) {
return def;
}
return settings[key];
}
export function settings_put(key, value) {
settings[key] = value;
setTimeout(() => {
window.localStorage.setItem("settings", JSON.stringify(settings));
}, 0);
}