feat: implement preview work units preference with local storage support
All checks were successful
Publish Container / publish (push) Successful in 3m16s

This commit is contained in:
MaddoScientisto 2026-04-20 23:17:35 +02:00
commit 0991128b30
4 changed files with 104 additions and 5 deletions

View file

@ -55,4 +55,35 @@ window.workTrackerTheme = (() => {
};
})();
window.workTrackerPreferences = {
getBool(key) {
try {
const value = localStorage.getItem(key);
if (value === null) {
return null;
}
if (value === "true") {
return true;
}
if (value === "false") {
return false;
}
return null;
}
catch {
return null;
}
},
setBool(key, value) {
try {
localStorage.setItem(key, value ? "true" : "false");
}
catch {
}
}
};
window.workTrackerTheme.init();