Initial Wi-Fi Config: Fix Bug with SAVEDATA

In some conditions, if the save button is pressed more than once, or the page is refreshed several times, the Wi-Fi credentials checking routine was disabling SAVEDATA in flash. This Fixs that condition.
This commit is contained in:
Adrian Scillato 2021-07-09 13:27:47 -03:00 committed by GitHub
parent 04618687cf
commit bb8e787947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -1792,16 +1792,17 @@ void HandleWifiConfiguration(void) {
if ( WifiIsInManagerMode() ) {
// Test WIFI Connection to Router
// As Tasmota is in this case in AP mode, a STA connection can be established too at the same time
if (WIFI_NOT_TESTING == Web.wifiTest) {
if (MAX_WIFI_OPTION == Web.old_wificonfig) { Web.old_wificonfig = Settings->sta_config; }
TasmotaGlobal.wifi_state_flag = Settings->sta_config = WIFI_MANAGER;
Web.save_data_counter = TasmotaGlobal.save_data_counter;
}
Web.wifi_test_counter = 9; // seconds to test user's proposed AP
Web.wifiTest = WIFI_TESTING;
Web.save_data_counter = TasmotaGlobal.save_data_counter;
TasmotaGlobal.save_data_counter = 0; // Stop auto saving data - Updating Settings
Settings->save_data = 0;
if (MAX_WIFI_OPTION == Web.old_wificonfig) { Web.old_wificonfig = Settings->sta_config; }
TasmotaGlobal.wifi_state_flag = Settings->sta_config = WIFI_MANAGER;
TasmotaGlobal.sleep = 0; // Disable sleep
TasmotaGlobal.restart_flag = 0; // No restart
TasmotaGlobal.ota_state_flag = 0; // No OTA