cache: managed localStorage & sessionStorage
ui: remember panel state
This commit is contained in:
parent
ad4a8ff110
commit
bd6c70f8e8
6 changed files with 88 additions and 16 deletions
|
|
@ -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(()=>{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue