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

Commit 85727e5

Browse files
iota.lib.js API changes.
1 parent 2dee18f commit 85727e5

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

ui/js/iota.lightwallet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ iota.api.attachToTangle = function(trunkTransaction, branchTransaction, minWeigh
99
console.log(success);
1010
}
1111
if (callback) {
12-
return callback(error, {"trytes": success})
12+
return callback(error, success);
1313
} else {
1414
return success;
1515
}

ui/js/ui.modals.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ var UI = (function(UI, $, undefined) {
4848
return;
4949
}
5050

51-
iota.api.getNeighbors(function(error, activity) {
51+
iota.api.getNeighbors(function(error, neighbors) {
5252
if (error) {
5353
return (callback ? callback(error) : error);
5454
}
5555

5656
var html = "";
5757

58-
if (!activity.neighbors) {
58+
if (!neighbors) {
5959
html = "<p>No neighbors found.</p>";
6060
} else {
61-
for (var i=0; i<activity.neighbors.length; i++) {
62-
var peer = activity.neighbors[i];
61+
for (var i=0; i<neighbors.length; i++) {
62+
var peer = neighbors[i];
6363

6464
html += "<div class='list'><ul>";
6565

@@ -69,17 +69,17 @@ var UI = (function(UI, $, undefined) {
6969

7070
html += "</ul></div>";
7171

72-
if (i<activity.neighbors.length-1) {
72+
if (i<neighbors.length-1) {
7373
html += "<br><br>";
7474
}
7575
}
7676

7777
if (callback) {
78-
callback(null, "peers-modal", "<h1>Neighbors (" + activity.neighbors.length + ")</h1><div class='contents'>" + html + "</div>");
78+
callback(null, "peers-modal", "<h1>Neighbors (" + neighbors.length + ")</h1><div class='contents'>" + html + "</div>");
7979
} else {
8080
var $modal = $("#peers-modal");
8181

82-
$("#peer-count").html(activity.neighbors.length);
82+
$("#peer-count").html(neighbors.length);
8383

8484
$modal.find(".contents").html(html);
8585

ui/js/ui.utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,21 +176,21 @@ var UI = (function(UI, $, undefined) {
176176

177177
UI.addAndRemoveNeighbors = function(addNodes, removeNodes) {
178178
if (addNodes && addNodes.length) {
179-
iota.api.addNeighbors(addNodes, function(error, success) {
179+
iota.api.addNeighbors(addNodes, function(error, addedNodes) {
180180
if (error) {
181181
UI.notify("error", "Error whilst adding neighbors.");
182182
} else {
183-
UI.notify("success", "Added " + addNodes.length + " neighbor" + (addNodes.length != 1 ? "s" : "") + ".");
183+
UI.notify("success", "Added " + addedNodes + " neighbor" + (addedNodes != 1 ? "s" : "") + ".");
184184
}
185185
});
186186
}
187187

188188
if (removeNodes && removeNodes.length) {
189-
iota.api.addNeighbors(removeNodes, function(error, success) {
189+
iota.api.addNeighbors(removeNodes, function(error, removedNodes) {
190190
if (error) {
191191
UI.notify("error", "Error whilst removing neighbors.");
192192
} else {
193-
UI.notify("success", "Removed " + removeNodes.length + " neighbor" + (removeNodes.length != 1 ? "s" : "") + ".");
193+
UI.notify("success", "Removed " + removedNodes + " neighbor" + (removedNodes != 1 ? "s" : "") + ".");
194194
}
195195
});
196196
}

0 commit comments

Comments
 (0)