diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 2adc7383..a85587b3 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -1334,7 +1334,7 @@ void WiFiManager::handleRoot() { String page = getHTTPHead(_title); // @token options @todo replace options with title String str = FPSTR(HTTP_ROOT_MAIN); // @todo custom title str.replace(FPSTR(T_t),_title); - str.replace(FPSTR(T_v), _subtitle.length() ? _subtitle : ( // Use subtitle, use AP name or ip + str.replace(FPSTR(T_v), _subtitle.length() ? _subtitle : ( // Use subtitle, AP name or ip configPortalActive ? _apName : (getWiFiHostname() + " - " + WiFi.localIP().toString()))); page += str; page += FPSTR(HTTP_PORTAL_OPTIONS); @@ -3878,8 +3878,9 @@ void WiFiManager::handleUpdate() { if (captivePortal()) return; // If captive portal redirect instead of displaying the page String page = getHTTPHead(_title); // @token options String str = FPSTR(HTTP_ROOT_MAIN); - str.replace(FPSTR(T_t), _title); - str.replace(FPSTR(T_v), configPortalActive ? _apName : (getWiFiHostname() + " - " + WiFi.localIP().toString())); // use ip if ap is not active for heading + str.replace(FPSTR(T_t), _title); + str.replace(FPSTR(T_v), _subtitle.length() ? _subtitle : ( // Use subtitle, AP name or ip + configPortalActive ? _apName : (getWiFiHostname() + " - " + WiFi.localIP().toString()))); page += str; page += FPSTR(HTTP_UPDATE); @@ -3988,8 +3989,9 @@ void WiFiManager::handleUpdateDone() { String page = getHTTPHead(FPSTR(S_options)); // @token options String str = FPSTR(HTTP_ROOT_MAIN); - str.replace(FPSTR(T_t),_title); - str.replace(FPSTR(T_v), configPortalActive ? _apName : WiFi.localIP().toString()); // use ip if ap is not active for heading + str.replace(FPSTR(T_t),_title); + str.replace(FPSTR(T_v), _subtitle.length() ? _subtitle : ( // Use subtitle, AP name or ip + configPortalActive ? _apName : (getWiFiHostname() + " - " + WiFi.localIP().toString()))); page += str; if (Update.hasError()) {