Emptying user wifi variables if connection was not possible
@@ -2695,10 +2695,31 @@ int DeRestPluginPrivate::putWifiUpdated(const ApiRequest &req, ApiResponse &rsp)
gwWifiActive = QLatin1String("inactive");
}
+ bool changed = false;
+ if (!gwWifiName.isEmpty())
+ {
+ gwWifiName = QString();
+ changed = true;
+ }
+ if (!gwWifiPw.isEmpty())
+ {
+ gwWifiPw = QString();
+ changed = true;
+ }
+ if (!gwWifiType.isEmpty())
+ {
+ gwWifiType = QString();
+ changed = true;
+ }
gwWifiWorkingName = QString();
gwWifiWorkingPw = QString();
//gwWifiWorkingType = QString();
+ if (changed)
+ {
+ queSaveDb(DB_CONFIG | DB_SYNC, DB_SHORT_SAVE_DELAY);
+ }
+
updateEtag(gwConfigEtag);
}
else if (status == QLatin1String("client-connect-fail") && gwWifiStateString != QLatin1String("client-connect-fail"))
@@ -2710,10 +2731,31 @@ int DeRestPluginPrivate::putWifiUpdated(const ApiRequest &req, ApiResponse &rsp)
gwWifiActive = QLatin1String("inactive");
}
+ bool changed = false;
+ if (!gwWifiName.isEmpty())
+ {
+ gwWifiName = QString();
+ changed = true;
+ }
+ if (!gwWifiPw.isEmpty())
+ {
+ gwWifiPw = QString();
+ changed = true;
+ }
+ if (!gwWifiType.isEmpty())
+ {
+ gwWifiType = QString();
+ changed = true;
+ }
gwWifiWorkingName = QString();
gwWifiWorkingPw = QString();
//gwWifiWorkingType = QString();
+ if (changed)
+ {
+ queSaveDb(DB_CONFIG | DB_SYNC, DB_SHORT_SAVE_DELAY);
+ }
+
updateEtag(gwConfigEtag);
}
else if (status == QLatin1String("check-ap") && gwWifiStateString != QLatin1String("check-ap"))
