cache: managed localStorage & sessionStorage

ui: remember panel state
This commit is contained in:
bordun 2020-07-14 11:10:24 +02:00
parent ad4a8ff110
commit bd6c70f8e8
6 changed files with 88 additions and 16 deletions

View file

@ -1,14 +1,15 @@
var EventEmitter = require('../events/event-emitter'),
cache = require('../managers/cache'),
nanoid = require('nanoid/generate'), uuid,
notifications,
locales
var localUuid = ENV.id || sessionStorage.getItem('osc.uuid')
var localUuid = ENV.id || cache.get('osc.uuid', false)
if (localUuid) {
uuid = localUuid
} else {
uuid = nanoid('0123456789abcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ', 10)
sessionStorage.setItem('osc.uuid', uuid)
cache.set('uuid', uuid, false)
}
setTimeout(()=>{