add notpending in proposals
This commit is contained in:
parent
d7e025c2d0
commit
8c43f55756
6 changed files with 51 additions and 66 deletions
|
|
@ -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();
|
||||
})
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
.wallet-activity {
|
||||
|
||||
&-not-pending {
|
||||
background-color:#eee;
|
||||
}
|
||||
|
||||
&-amount {
|
||||
float: right;
|
||||
font-size: 18px;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue