upload file
This commit is contained in:
commit
76e4ad35be
1570 changed files with 418989 additions and 0 deletions
1
web/modules/emby-apiclient/appstorage-localstorage.js
Normal file
1
web/modules/emby-apiclient/appstorage-localstorage.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
function onCachePutFail(e){console.log(e)}function updateCache(instance){var cache=instance.cache;cache&&cache.put("data",new Response(JSON.stringify(instance.localData))).catch(onCachePutFail)}function onCacheOpened(result){this.cache=result,this.localData={}}function onCacheOpenFailed(err){return console.log("Error opening cache: "+err),this.localData={},Promise.resolve()}function MyStore(){}MyStore.prototype.init=function(){try{"undefined"!=typeof caches&&caches.open("embydata").then(onCacheOpened.bind(this),onCacheOpenFailed.bind(this))}catch(err){console.log("Error opening cache: "+err)}return Promise.resolve()},MyStore.prototype.setItem=function(name,value){localStorage.setItem(name,value);var localData=this.localData;localData&&localData[name]!==value&&(localData[name]=value,updateCache(this))},MyStore.prototype.getItem=function(name){return localStorage.getItem(name)},MyStore.prototype.removeItem=function(name){localStorage.removeItem(name);var localData=this.localData;localData&&(localData[name]=null,delete localData[name],updateCache(this))};export default new MyStore;
|
||||
Loading…
Add table
Add a link
Reference in a new issue