Skip to content

Commit 31982d7

Browse files
committed
Fixed wrong credentials management
1 parent 9cb1cd1 commit 31982d7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

arduino-cloud.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
window.connectionManager = [];
33

44
function validator(v) {
5-
return (v !== null && v !== undefined && v !== "");
5+
return (v !== null && v !== undefined && v !== "" && v !== "err");
66
}
77

88
function validateConnection(v) {
@@ -86,7 +86,7 @@
8686
$("select#node-input-property").empty();
8787
$("<option value='" + "" + "'> " + "No connection selected" + "</option>").appendTo("#node-input-property");
8888
$("#node-input-property").trigger("change");
89-
} else if (thing_id !== "updating" && property_id !== "updating" && thing_text !== " Wrong credentials or system unavailable.") {
89+
} else if (thing_id !== "updating" && property_id !== "updating" && thing_id !== "err") {
9090
if (thing_id === undefined || thing_id === null || thing_id === "") {
9191
$("select#node-input-property").empty();
9292
$("<option value='" + "" + "'> " + "No thing selected" + "</option>").appendTo("#node-input-property");
@@ -164,7 +164,7 @@
164164
$("select#node-input-thing").empty();
165165
if (things && typeof (things) == "object" && things.error) {
166166
$("select#node-input-thing").empty();
167-
$("<option value='" + "" + "'> " + things.error + "</option>").appendTo("#node-input-thing");
167+
$("<option value='" + "err" + "'> " + things.error + "</option>").appendTo("#node-input-thing");
168168
$("select#node-input-property").empty();
169169
$("<option value='" + "" + "'> " + things.error + "</option>").appendTo("#node-input-property");
170170
$("#node-input-thing").trigger("change");
@@ -200,10 +200,8 @@
200200
$.getJSON(`properties?${queryString}`, properties => {
201201
$("select#node-input-property").empty();
202202
if (properties && typeof (properties) == "object" && properties.error) {
203-
$("select#node-input-thing").empty();
204-
$("<option value='" + "" + "'> " + things.error + "</option>").appendTo("#node-input-thing");
205203
$("select#node-input-property").empty();
206-
$("<option value='" + "" + "'> " + things.error + "</option>").appendTo("#node-input-property");
204+
$("<option value='" + "" + "'> " + properties.error + "</option>").appendTo("#node-input-property");
207205
} else if ((properties && Array.isArray(properties) && properties.length !== 0)) {
208206
$("<option value='" + "" + "'> " + "Select a property" + "</option>").appendTo("#node-input-property");
209207
for (const p of properties) {

0 commit comments

Comments
 (0)