This commit is contained in:
ed 2021-10-07 23:11:37 +02:00
parent d500a51d97
commit 1a618c3c97

View file

@ -583,14 +583,22 @@ function jcp(obj) {
function sread(key) { function sread(key) {
return localStorage.getItem(key); try {
return localStorage.getItem(key);
}
catch (e) {
return null;
}
} }
function swrite(key, val) { function swrite(key, val) {
if (val === undefined || val === null) try {
localStorage.removeItem(key); if (val === undefined || val === null)
else localStorage.removeItem(key);
localStorage.setItem(key, val); else
localStorage.setItem(key, val);
}
catch (e) { }
} }
function jread(key, fb) { function jread(key, fb) {