diff options
author | Jesús <heckyel@hyperbola.info> | 2022-04-06 04:28:42 +0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-04-06 04:28:42 +0800 |
commit | 096250c53aebeea35a117143c02893343621d0ad (patch) | |
tree | 4468e0d84f58500b611bc1b2e7367819d0e2c21a | |
parent | c2a2e0aa01f537e1027ee474efff8ade9f576899 (diff) | |
download | ematrix-096250c53aebeea35a117143c02893343621d0ad.tar.lz ematrix-096250c53aebeea35a117143c02893343621d0ad.tar.xz ematrix-096250c53aebeea35a117143c02893343621d0ad.zip |
Fix a few things
-rw-r--r-- | js/assets.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/js/assets.js b/js/assets.js index 84419d2..2c0e3cb 100644 --- a/js/assets.js +++ b/js/assets.js @@ -531,6 +531,8 @@ }; if (error) { details.error = assetDetails.lastError = error; + } else { + assetDetails.lastError = undefined; } callback(details); }; @@ -626,6 +628,9 @@ }; let updateNext = function () { + let cacheReg = undefined; + let sourceReg = undefined; + let gcOne = function (key) { let entry = cacheRegistry[key]; if (entry && entry.readTime < cacheRegistryStart) { @@ -666,7 +671,7 @@ let onUpdate = function (details) { if (details.content !== '') { updated.push(details.assetKey); - if (details.assetKey === 'asset.json') { + if (details.assetKey === 'assets.json') { updateSourceRegistry(details.content); } } else { @@ -694,10 +699,12 @@ }; let onSourceReady = function (registry) { + sourceReg = registry; updateOne(); }; let onCacheReady = function (registry) { + cacheReg = registry; getSourceRegistry(onSourceReady); }; @@ -978,7 +985,7 @@ updateDelay = Math.min(oldDelay, newDelay); - if (updateStatus === 'running') { + if (updateStatus !== undefined) { if (newDelay < oldDelay) { clearTimeout(updateTimer); updateTimer = vAPI.setTimeout(updateNext, updateDelay); |