Merge pull request #4423 from andrethomas/patch-1

Increase delays before web ui is refreshed
This commit is contained in:
Theo Arends 2018-11-24 12:05:08 +01:00 committed by GitHub
commit 4aadc328ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -95,7 +95,12 @@ const char HTTP_SCRIPT_WIFI[] PROGMEM =
"}";
const char HTTP_SCRIPT_RELOAD[] PROGMEM =
"setTimeout(function(){location.href='.';},5000);"
"setTimeout(function(){location.href='.';},9000);"
"</script>";
// Local OTA upgrade requires more time to complete cp: before web ui should be reloaded
const char HTTP_SCRIPT_RELOAD_OTA[] PROGMEM =
"setTimeout(function(){location.href='.';},20000);"
"</script>";
const char HTTP_SCRIPT_CONSOL[] PROGMEM =
@ -1463,7 +1468,7 @@ void HandleUploadDone(void)
} else {
page += F("green'>" D_SUCCESSFUL "</font></b><br/>");
page += FPSTR(HTTP_MSG_RSTRT);
page.replace(F("</script>"), FPSTR(HTTP_SCRIPT_RELOAD));
page.replace(F("</script>"), FPSTR(HTTP_SCRIPT_RELOAD_OTA)); // Refesh main web ui after OTA upgrade
ShowWebSource(SRC_WEBGUI);
restart_flag = 2; // Always restart to re-enable disabled features during update
}