@@ -161,18 +161,31 @@ void ota_function() {
161161 if (returnToMenu) return ;
162162 if (fav) {
163163 int idx = 0 ;
164- RELOAD:
165- options.clear ();
166- for (JsonObject item : favorite) {
167- if (item[" fid" ].as <String>().length () > 0 ) {
168- options.push_back ({item[" name" ].as <String>(), [=]() {
169- loopVersions (item[" fid" ].as <String>());
164+ auto NavMenu = [&](int fw) {
165+ options.clear ();
166+ if (favorite[fw][" fid" ].as <String>().length () > 0 ) {
167+ options.push_back ({" View firmware" , [=]() {
168+ loopVersions (favorite[fw][" fid" ].as <String>());
170169 }});
171170 } else {
172- options.push_back ({item[ " name " ]. as <String>() , [=]() {
173- installExtFirmware (item [" link" ].as <String>());
171+ options.push_back ({" Install " , [=]() {
172+ installExtFirmware (favorite[fw] [" link" ].as <String>());
174173 }});
175174 }
175+ options.push_back ({" Remove Favorite" , [=]() {
176+ favorite.remove (fw);
177+ saveConfigs ();
178+ }});
179+ options.push_back ({" Back to List" , [=]() { /* Do nothing, just return */ }});
180+ options.push_back ({" Main Menu" , [=]() { returnToMenu = true ; }});
181+ loopOptions (options);
182+ };
183+ RELOAD:
184+ options.clear ();
185+ int count = 0 ;
186+ for (JsonObject item : favorite) {
187+ options.push_back ({item[" name" ].as <String>(), [=]() { NavMenu (count); }});
188+ count++;
176189 }
177190 options.push_back ({" Main Menu" , [=]() { returnToMenu = true ; }, ALCOLOR});
178191 idx = loopOptions (options, false , FGCOLOR, BGCOLOR, false , idx);
@@ -442,8 +455,8 @@ bool installExtFirmware(String url) {
442455 for (int i = 0x0 ; i <= 0x1A0 ; i += 0x20 ) { // Partition
443456 memcpy (bytes, &buff[i], 16 );
444457
445- // https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/partition-tables.html ->
446- // spiffs (0x82) is for SPIFFS Filesystem.
458+ // https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/partition-tables.html
459+ // -> spiffs (0x82) is for SPIFFS Filesystem.
447460
448461 // if (bytes[3] == 0xFF) Serial.println(": ------- END of Table ------- |");
449462 if (bytes[3 ] == 0x00 || (bytes[3 ] >= 0x10 && bytes[3 ] <= 0x1F )) {
0 commit comments