[SYS] Fix connection validation on unknown indexes and improve erase method (#2075)

Before this fix, connections with Index 1 and 2 were supposed valid when not present in the configuration, generating attempts to connect with those indexes.
Also improve the erase config by adding an erase when the config file is not present (ESP is connected to WiFi without the config file). This way the ESP will not reconnect to the WiFi AP.

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
FlorianandFlorian authored and GitHub committed 2024-10-01 11:48:39 -05:00
1 parent 9e5f56580d
commit c234afa9c8
3 files changed
+24 -25

No files matched your search

+2 -2
View File
@@ -46,7 +46,7 @@ QueueHandle_t webUIQueue;
WebServer server(80);
/*------------------- External functions ----------------------*/
extern void eraseAndRestart();
extern void erase(bool restart);
extern unsigned long uptime();
/*------------------- Web Console Globals ----------------------*/
@@ -1237,7 +1237,7 @@ void handleRT() {
response += String(buffer);
server.send(200, "text/html", response);
eraseAndRestart();
erase(true);
} else {
handleCN();
}