mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
bug fix
This commit is contained in:
parent
5dc2ecd741
commit
02ea4d1116
@ -30,7 +30,7 @@ if (typeof sessionStorage !== 'undefined') {
|
||||
let decode = opts.decode || identity;
|
||||
if (opts.listen) console.error('sessionAtom does not support "listen" option');
|
||||
|
||||
let store = atom(sessionStorage[name] ? decode(sessionStorage[name]) : initial);
|
||||
let store = atom(typeof sessionStorage[name] !== 'undefined' ? decode(sessionStorage[name]) : initial);
|
||||
|
||||
store.listen((newValue) => {
|
||||
if (typeof newValue === 'undefined') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user