diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2019-05-27 16:53:43 +0200 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2019-05-27 16:53:43 +0200 |
commit | a7de3b950c9cf73e5fc94e3e58e31bdfd759ef53 (patch) | |
tree | d9922371db596672784b89470c14a62c2bfd4570 | |
parent | 9e544679ac4dff01aebf38bdba3bd038d605bd89 (diff) | |
download | ematrix-a7de3b950c9cf73e5fc94e3e58e31bdfd759ef53.tar.lz ematrix-a7de3b950c9cf73e5fc94e3e58e31bdfd759ef53.tar.xz ematrix-a7de3b950c9cf73e5fc94e3e58e31bdfd759ef53.zip |
Load cache earlier
The cache should be available, either read from the database or as an
empty object, before any asset is fetched.
-rw-r--r-- | js/assets.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/assets.js b/js/assets.js index 7a04a32..e62bb5d 100644 --- a/js/assets.js +++ b/js/assets.js @@ -105,6 +105,16 @@ cacheRegistryCallbacks = [callback]; cacheRegistryReady = true; + + let onRead = function (bin) { + if (!bin || !bin['assetCacheRegistry']) { + cacheRegistry = {}; + } else { + cacheRegistry = bin['assetCacheRegistry']; + } + }; + + vAPI.cacheStorage.get('assetCacheRegistry', onRead); let f; while ((f = cacheRegistryCallbacks.shift())) { |