mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update storage
This commit is contained in:
parent
9fc4c86111
commit
3beaf88745
15 changed files with 36 additions and 29 deletions
|
@ -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) {
|
||||
|
|
4
dashboard-ui/thirdparty/apiclient/device.js
vendored
4
dashboard-ui/thirdparty/apiclient/device.js
vendored
|
@ -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);
|
||||
|
|
2
dashboard-ui/thirdparty/apiclient/store.js
vendored
2
dashboard-ui/thirdparty/apiclient/store.js
vendored
|
@ -44,7 +44,7 @@
|
|||
};
|
||||
}
|
||||
|
||||
globalScope.store = new myStore(localStorage);
|
||||
globalScope.appStorage = new myStore(localStorage);
|
||||
globalScope.sessionStore = new myStore(sessionStorage);
|
||||
|
||||
})(window, window.localStorage, window.sessionStorage);
|
Loading…
Add table
Add a link
Reference in a new issue