diff --git a/public/views/includes/txp.html b/public/views/includes/txp.html index 0749fd310..183c49f90 100644 --- a/public/views/includes/txp.html +++ b/public/views/includes/txp.html @@ -1,23 +1,31 @@ - - - - {{addressbook[tx.toAddress]}} - - - {{tx.message}} - - - Sending - - - - {{tx.merchant.domain}} - {{tx.merchant.domain}} - - - - {{tx.amountStr}} - -
- {{tx.wallet.name}} · -
+
+ + + {{addressbook[tx.toAddress]}} + + + {{tx.message}} + + + Sending + + + + {{tx.merchant.domain}} + {{tx.merchant.domain}} + + + + +
+ {{tx.amountStr}} +
+ + +

+ + {{tx.wallet.name}} + +

+
diff --git a/public/views/proposals.html b/public/views/proposals.html index 515d8e050..0f3306ddc 100644 --- a/public/views/proposals.html +++ b/public/views/proposals.html @@ -11,7 +11,7 @@
- + diff --git a/public/views/tab-home.html b/public/views/tab-home.html index 204fee2ed..2c65004c2 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -14,7 +14,7 @@ {{txpsN}} - +
diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 3fcccd64d..ac8ef2750 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -7,17 +7,24 @@ angular.module('copayApp.controllers').controller('tabHomeController', $scope.bitpayCardEnabled = true; // TODO + function updateTxps() { + profileService.getTxps({ + limit: 3 + }, function(err, txps, n) { + if (err) { + console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO + } + $scope.txps = txps; + $scope.txpsN = n; + $ionicScrollDelegate.resize(); - var setPendingTxps = function(txps) { - if (!txps) { - $scope.txps = []; - return; - } - $scope.txps = lodash.sortBy(txps, 'createdOn').reverse(); + $timeout(function() { + $scope.$apply(); + }, 1); + }) }; - $scope.updateAllWallets = function() { $scope.wallets = profileService.getWallets(); if (lodash.isEmpty($scope.wallets)) return; @@ -35,20 +42,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', wallet.status = status; } if (++j==i) { - profileService.getTxps({ - limit: 3 - }, function(err, txps, n) { - if (err) { - console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO - } - $scope.txps = txps; - $scope.txpsN = n; - $ionicScrollDelegate.resize(); - - $timeout(function() { - $scope.$apply(); - }, 1); - }); + updateTxps(); } }); }); @@ -92,20 +86,7 @@ angular.module('copayApp.controllers').controller('tabHomeController', } $scope.notifications = notifications; - profileService.getTxps({ - limit: 3 - }, function(err, txps, n) { - if (err) { - console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO - } - $scope.txps = txps; - $scope.txpsN = n; - $ionicScrollDelegate.resize(); - - $timeout(function() { - $scope.$apply(); - }, 1); - }) + updateTxps(); }) }); }; diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 8fb2df403..dbad76e34 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -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; diff --git a/src/sass/views/includes/walletActivity.scss b/src/sass/views/includes/walletActivity.scss index d5f723582..af7ff4c65 100644 --- a/src/sass/views/includes/walletActivity.scss +++ b/src/sass/views/includes/walletActivity.scss @@ -1,5 +1,9 @@ .wallet-activity { + &-not-pending { + background-color:#eee; + } + &-amount { float: right; font-size: 18px;