Reconsidered the logic

pull/123/head
Hieromon Ikasamo 6 years ago
parent 379298091f
commit d2eac80930
  1. 15
      src/AutoConnectUpdate.cpp

@ -525,10 +525,10 @@ void AutoConnectUpdateAct::_progress(void) {
switch (_webServer->method()) {
case HTTP_POST:
if (_webServer->hasArg(reqOperation)) {
reqOperand = _webServer->arg(reqOperation);
switch (_status) {
case UPDATE_IDLE:
if (reqOperand == String(UPDATE_NOTIFY_START)) {
if (_status == UPDATE_IDLE) {
httpCode = 200;
_status = UPDATE_START;
}
@ -536,9 +536,9 @@ void AutoConnectUpdateAct::_progress(void) {
payload = String(FPSTR(reply_msg_seq));
httpCode = 500;
}
}
else if (reqOperand == String(UPDATE_NOTIFY_REBOOT)) {
if (_status == UPDATE_SUCCESS) {
break;
case UPDATE_SUCCESS:
if (reqOperand == String(UPDATE_NOTIFY_REBOOT)) {
_status = UPDATE_RESET;
httpCode = 200;
}
@ -546,9 +546,8 @@ void AutoConnectUpdateAct::_progress(void) {
payload = String(FPSTR(reply_msg_seq));
httpCode = 500;
}
}
}
else {
break;
default:
payload = String(FPSTR(reply_msg_op));
httpCode = 500;
}

Loading…
Cancel
Save