mirror of https://github.com/espruino/BangleApps
fastload: fix caching
broken since e2ba3ca64
(fastload - Replace E.CRC32 with Storage.hash, 2023-07-24)
Storage.hash() expects a regex (or apparently the name as a string) to match files that should be hashed, but was called with the contents of the file
pull/2916/head
parent
ddc9ac34b1
commit
97fa54c2d6
|
@ -3,3 +3,4 @@
|
||||||
0.03: Allow hiding the fastloading info screen
|
0.03: Allow hiding the fastloading info screen
|
||||||
0.04: (WIP) Allow use of app history when going back (`load()` or `Bangle.load()` calls without specified app).
|
0.04: (WIP) Allow use of app history when going back (`load()` or `Bangle.load()` calls without specified app).
|
||||||
0.05: Check for changes in setting.js and force real reload if needed
|
0.05: Check for changes in setting.js and force real reload if needed
|
||||||
|
0.06: Fix caching whether an app is fastloadable
|
||||||
|
|
|
@ -30,12 +30,13 @@ let appFastloadPossible = function(n){
|
||||||
|
|
||||||
// no widgets, no problem
|
// no widgets, no problem
|
||||||
if (!global.WIDGETS) return true;
|
if (!global.WIDGETS) return true;
|
||||||
let app = s.read(n);
|
let hash = s.hash(n);
|
||||||
if (cache[n] && s.hash(app) == cache[n].hash)
|
if (cache[n] && hash == cache[n].hash)
|
||||||
return cache[n].fast;
|
return cache[n].fast;
|
||||||
|
let app = s.read(n);
|
||||||
cache[n] = {};
|
cache[n] = {};
|
||||||
cache[n].fast = app.includes("Bangle.loadWidgets");
|
cache[n].fast = app.includes("Bangle.loadWidgets");
|
||||||
cache[n].hash = s.hash(app);
|
cache[n].hash = hash;
|
||||||
s.writeJSON("fastload.cache", cache);
|
s.writeJSON("fastload.cache", cache);
|
||||||
return cache[n].fast;
|
return cache[n].fast;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ "id": "fastload",
|
{ "id": "fastload",
|
||||||
"name": "Fastload Utils",
|
"name": "Fastload Utils",
|
||||||
"shortName" : "Fastload Utils",
|
"shortName" : "Fastload Utils",
|
||||||
"version": "0.05",
|
"version": "0.06",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"description": "Enable experimental fastloading for more apps",
|
"description": "Enable experimental fastloading for more apps",
|
||||||
"type":"bootloader",
|
"type":"bootloader",
|
||||||
|
|
Loading…
Reference in New Issue