Fixed factory reset

This commit is contained in:
Gunnar Skjold
2020-09-05 20:03:06 +02:00
parent a2c1c8fc61
commit 644a3fa40b
3 changed files with 11 additions and 4 deletions

View File

@@ -1403,9 +1403,13 @@ void AmsWebServer::factoryResetHtml() {
}
void AmsWebServer::factoryResetPost() {
printD("Performing factory reset");
if(server.hasArg("perform") && server.arg("perform") == "true") {
printD("Formatting SPIFFS");
SPIFFS.format();
printD("Clearing configuration");
config->clear();
printD("Setting restart flag and redirecting");
performRestart = true;
server.sendHeader("Location","/restart-wait");
server.send(303);