Skip to content

Commit

Permalink
allow mqtt field to be blank again once filled in
Browse files Browse the repository at this point in the history
  • Loading branch information
CircuitSetup committed Nov 8, 2019
1 parent 5b76aab commit 118767c
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions Software/EmonESP/src/data/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,19 +303,15 @@ function EmonEspViewModel() {
pass: self.config.mqtt_pass()
};

if (mqtt.server === "") {
alert("Please enter MQTT server");
} else {
self.saveMqttFetching(true);
self.saveMqttSuccess(false);
$.post(baseEndpoint + "/savemqtt", mqtt, function (data) {
self.saveMqttSuccess(true);
}).fail(function () {
alert("Failed to save MQTT config");
}).always(function () {
self.saveMqttFetching(false);
});
}
self.saveMqttFetching(true);
self.saveMqttSuccess(false);
$.post(baseEndpoint + "/savemqtt", mqtt, function (data) {
self.saveMqttSuccess(true);
}).fail(function () {
alert("Failed to save MQTT config");
}).always(function () {
self.saveMqttFetching(false);
});
};
// -----------------------------------------------------------------------
// Event: Calibration save
Expand Down

0 comments on commit 118767c

Please sign in to comment.