add notpending in proposals

This commit is contained in:
Matias Alejo Garcia 2016-09-02 14:33:18 -03:00
commit 8c43f55756
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
6 changed files with 51 additions and 66 deletions

View file

@ -908,22 +908,14 @@ angular.module('copayApp.services')
var txps = [];
function process(notifications) {
if (!notifications) return [];
var shown = lodash.sortBy(notifications, 'createdOn').reverse();
shown = shown.splice(0, opts.limit || MAX);
return shown;
};
lodash.each(w, function(x) {
if (x.pendingTxps)
txps = txps.concat(x.pendingTxps);
});
txps = lodash.sortBy(txps, 'createdOn');
txps = lodash.sortBy(txps, 'pendingForUs', 'createdOn');
txps = lodash.compact(lodash.flatten(txps)).slice(0,MAX);
var n = txps.length;
return cb(null, process(txps), n);
return cb(null, txps, n);
};
return root;