diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-26 23:22:40 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-26 23:22:40 +0800 |
commit | d0b6f3663b70c325eb0d1474c3c5df51e53c2cee (patch) | |
tree | f184e1d6538f95276e022a12ff316d4ababea82c /dist/ethereum.js | |
parent | 81bbe8c93b22007c62949ab5f141aec255134385 (diff) | |
download | dexon-d0b6f3663b70c325eb0d1474c3c5df51e53c2cee.tar dexon-d0b6f3663b70c325eb0d1474c3c5df51e53c2cee.tar.gz dexon-d0b6f3663b70c325eb0d1474c3c5df51e53c2cee.tar.bz2 dexon-d0b6f3663b70c325eb0d1474c3c5df51e53c2cee.tar.lz dexon-d0b6f3663b70c325eb0d1474c3c5df51e53c2cee.tar.xz dexon-d0b6f3663b70c325eb0d1474c3c5df51e53c2cee.tar.zst dexon-d0b6f3663b70c325eb0d1474c3c5df51e53c2cee.zip |
watches are calling callback with a single result object, not a full jsonrpc response
Diffstat (limited to 'dist/ethereum.js')
-rw-r--r-- | dist/ethereum.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dist/ethereum.js b/dist/ethereum.js index 81ac4b07b..c95d72ca3 100644 --- a/dist/ethereum.js +++ b/dist/ethereum.js @@ -573,8 +573,10 @@ Filter.prototype.changed = function(callback) { /// trigger calling new message from people Filter.prototype.trigger = function(messages) { - for(var i = 0; i < this.callbacks.length; i++) { - this.callbacks[i].call(this, messages); + for (var i = 0; i < this.callbacks.length; i++) { + for (var j = 0; j < messages; j++) { + this.callbacks[i].call(this, messages[j]); + } } }; @@ -716,12 +718,12 @@ var ProviderManager = function() { result = JSON.parse(result); - // dont call the callback if result is an error, empty array or false - if (result.error || (result.result instanceof Array ? result.result.length === 0 : !result.result)) { + // dont call the callback if result is not an array, or empty one + if (result.error || !(result.result instanceof Array) || result.result.length === 0) { return; } - data.callback(result); + data.callback(result.result); }); } setTimeout(poll, 12000); |