Skip to content

Commit

Permalink
Merge pull request #2916 from ssievert42/fastload
Browse files Browse the repository at this point in the history
fastload: fix caching
  • Loading branch information
gfwilliams authored Jul 31, 2023
2 parents edf45df + 97fa54c commit 7ba94c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/fastload/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
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.05: Check for changes in setting.js and force real reload if needed
0.06: Fix caching whether an app is fastloadable
7 changes: 4 additions & 3 deletions apps/fastload/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ let appFastloadPossible = function(n){

// no widgets, no problem
if (!global.WIDGETS) return true;
let app = s.read(n);
if (cache[n] && s.hash(app) == cache[n].hash)
let hash = s.hash(n);
if (cache[n] && hash == cache[n].hash)
return cache[n].fast;
let app = s.read(n);
cache[n] = {};
cache[n].fast = app.includes("Bangle.loadWidgets");
cache[n].hash = s.hash(app);
cache[n].hash = hash;
s.writeJSON("fastload.cache", cache);
return cache[n].fast;
};
Expand Down
2 changes: 1 addition & 1 deletion apps/fastload/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ "id": "fastload",
"name": "Fastload Utils",
"shortName" : "Fastload Utils",
"version": "0.05",
"version": "0.06",
"icon": "icon.png",
"description": "Enable experimental fastloading for more apps",
"type":"bootloader",
Expand Down

0 comments on commit 7ba94c1

Please sign in to comment.