From 568c82ac54a308fa92e805572ca998fc9d7fb902 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Mon, 23 Oct 2017 15:22:54 +0200 Subject: Added dynamic success message when saving settings --- IOT-clapSensor.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/IOT-clapSensor.ino b/IOT-clapSensor.ino index a6f236e..e6f0048 100644 --- a/IOT-clapSensor.ino +++ b/IOT-clapSensor.ino @@ -204,7 +204,7 @@ void handleJson() { } void handleSettings() { - + String successMsg = ""; String type, _deviceName, _deviceLocation, _ssid, _password; for (int i = 0; i < server.args(); i++) { String argKey = server.argName(i); @@ -232,12 +232,13 @@ void handleSettings() { MemoryAccess.writeAscii("Password", _password); } MemoryAccess.commit(); + successMsg = "Settings updated!"; while (1); } String htmlResponse = SETTINGS_page; htmlResponse.replace("{{NAME}}", deviceName); - htmlResponse.replace("{{SUCCESSMSG}}", ""); + htmlResponse.replace("{{SUCCESSMSG}}", successMsg); htmlResponse.replace("{{DEVICENAME}}", deviceName); htmlResponse.replace("{{DEVICELOCATION}}", deviceLocation); server.send( 200, "text/html", htmlResponse ); -- cgit v1.2.3