1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update storage

This commit is contained in:
Luke Pulverenti 2015-05-20 13:29:26 -04:00
parent 9fc4c86111
commit 3beaf88745
15 changed files with 36 additions and 29 deletions

View file

@ -12,7 +12,7 @@
function ensure() {
credentials = credentials || JSON.parse(store.getItem(key) || '{}');
credentials = credentials || JSON.parse(appStorage.getItem(key) || '{}');
credentials.servers = credentials.servers || [];
}
@ -26,7 +26,7 @@
if (data) {
credentials = data;
store.setItem(key, JSON.stringify(data));
appStorage.setItem(key, JSON.stringify(data));
} else {
self.clear();
}
@ -34,7 +34,7 @@
self.clear = function () {
credentials = null;
store.removeItem(key);
appStorage.removeItem(key);
};
self.credentials = function (data) {

View file

@ -17,13 +17,13 @@
var randomId = '';
// Since the above is not guaranteed to be unique per device, add a little more
randomId = store.getItem(keyName);
randomId = appStorage.getItem(keyName);
if (!randomId) {
randomId = new Date().getTime();
store.setItem(keyName, randomId.toString());
appStorage.setItem(keyName, randomId.toString());
}
keys.push(randomId);

View file

@ -44,7 +44,7 @@
};
}
globalScope.store = new myStore(localStorage);
globalScope.appStorage = new myStore(localStorage);
globalScope.sessionStore = new myStore(sessionStorage);
})(window, window.localStorage, window.sessionStorage);