0.15: Fix error when displaying a category with only one clockinfo (fix #3728)

master
Gordon Williams 2025-02-03 12:17:23 +00:00
parent 4154e24bb3
commit 62d3f803da
3 changed files with 4 additions and 3 deletions

View File

@ -12,4 +12,5 @@
0.11: Prepend swipe listener if possible
0.12: Add drawFilledImage to allow drawing icons with a separately coloured middle
0.13: Cache loaded ClockInfos so if we have clockInfoWidget and a clock, we don't load them twice (saves ~300ms)
0.14: Check for .clkinfocache and use that if exists (from boot 0.64)
0.14: Check for .clkinfocache and use that if exists (from boot 0.64)
0.15: Fix error when displaying a category with only one clockinfo (fix #3728)

View File

@ -283,7 +283,7 @@ exports.addInteractive = function(menu, options) {
//in the worst case we come back to 0
} while(menu[options.menuA].items.length==0);
// When we change, ensure we don't display the same thing as another clockinfo if we can avoid it
while ((options.menuB < menu[options.menuA].items.length) &&
while ((options.menuB < menu[options.menuA].items.length-1) &&
exports.clockInfos.some(m => (m!=options) && m.menuA==options.menuA && m.menuB==options.menuB))
options.menuB++;
}

View File

@ -1,7 +1,7 @@
{ "id": "clock_info",
"name": "Clock Info Module",
"shortName": "Clock Info",
"version":"0.14",
"version":"0.15",
"description": "A library used by clocks to provide extra information on the clock face (Altitude, BPM, etc)",
"icon": "app.png",
"type": "module",