feat: implement preview work units preference with local storage support
All checks were successful
Publish Container / publish (push) Successful in 3m16s
All checks were successful
Publish Container / publish (push) Successful in 3m16s
This commit is contained in:
parent
158906fa28
commit
0991128b30
4 changed files with 104 additions and 5 deletions
|
|
@ -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();
|
||||
Loading…
Add table
Add a link
Reference in a new issue