Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

Commit 19cf768

Browse files
Light node changing.
1 parent 51f22c5 commit 19cf768

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ui/js/ui.utils.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,20 +239,17 @@ var UI = (function(UI, $, undefined) {
239239

240240
var changeNode = false;
241241

242-
if (settings.hasOwnProperty("host")) {
242+
if (settings.hasOwnProperty("host") && settings.host != connection.host) {
243243
connection.host = settings.host;
244244
changeNode = true;
245245
}
246-
if (settings.hasOwnProperty("port")) {
246+
if (settings.hasOwnProperty("port") && settings.port != connection.port) {
247247
connection.port = settings.port;
248248
changeNode = true;
249249
}
250250

251251
if (changeNode) {
252-
iota = new IOTA({
253-
"host": connection.host,
254-
"port": connection.port
255-
});
252+
iota.changeNode({"host": connection.host, "port": connection.port});
256253
}
257254

258255
if (settings.hasOwnProperty("addedNodes") && settings.addedNodes.length) {

0 commit comments

Comments
 (0)