From 6a3e109f39e9761463ab6af36c6af1e2ede8ae66 Mon Sep 17 00:00:00 2001 From: Yemel Jardi Date: Mon, 4 Aug 2014 13:54:08 -0300 Subject: [PATCH] Sort copayer list at Tx proposal by creator --- js/services/controllerUtils.js | 13 ++++++++++++- views/transactions.html | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index 57a5faa13..9480fe74f 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -270,17 +270,28 @@ angular.module('copayApp.services') i.outs = outs; i.fee = i.builder.feeSat * satToUnit; i.missingSignatures = tx.countInputMissingSignatures(0); + i.actionList = getActionList(i.peerActions); txs.push(i); } }); - $rootScope.txs = txs; //.some(function(i) {return i.isPending; } ); + $rootScope.txs = txs; if ($rootScope.pendingTxCount < pendingForUs) { $rootScope.txAlertCount = pendingForUs; } $rootScope.pendingTxCount = pendingForUs; }; + function getActionList(actions) { + var peers = Object.keys(actions).map(function(i) { + return {cId: i, actions: actions[i] } + }); + + return peers.sort(function(a, b) { + return !!b.actions.create - !!a.actions.create; + }); + } + $rootScope.$watch('insightError', function(status) { if (status) { if (status === -1) { diff --git a/views/transactions.html b/views/transactions.html index d924b3465..8abdd703c 100644 --- a/views/transactions.html +++ b/views/transactions.html @@ -40,37 +40,37 @@
-
+
- {{cId}} + {{c.cId}}

- {{cId === $root.wallet.getMyCopayerId() ? 'Me' : $root.wallet.publicKeyRing.nicknameForCopayer(cId)}} + {{c.cId === $root.wallet.getMyCopayerId() ? 'Me' : $root.wallet.publicKeyRing.nicknameForCopayer(c.cId)}}