txps refresh WIP
This commit is contained in:
parent
db0cdec49e
commit
ac68106cbf
6 changed files with 20 additions and 11 deletions
|
|
@ -13,6 +13,7 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<div notifications="right top"></div>
|
||||
<ion-nav-view></ion-nav-view>
|
||||
|
||||
<script src="lib/ionic.bundle.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
<span>
|
||||
- {{tx.amountStr}}
|
||||
</span>
|
||||
<div class="item item-divider">
|
||||
<div class="item-note">
|
||||
{{tx.wallet.name}} · <time>{{ (tx.ts || tx.createdOn ) * 1000 | amTimeAgo}}</time>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -101,19 +101,24 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
}
|
||||
|
||||
self.updateWallet = function(wallet) {
|
||||
var txps = lodash.filter($scope.txps, function(x) {
|
||||
return x.walletId != wallet.id;
|
||||
});
|
||||
|
||||
|
||||
$log.debug('Updating wallet:'+ wallet.name)
|
||||
walletService.getStatus(wallet, {}, function(err, status) {
|
||||
console.log('[tab-home.js.107:status:]',status); //TODO
|
||||
if (err) {
|
||||
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
|
||||
return;
|
||||
}
|
||||
if (status.pendingTxps && status.pendingTxps[0]) {
|
||||
|
||||
console.log('[tab-home.js.113]', status.pendingTxps); //TODO
|
||||
var txps = lodash.filter($scope.txps, function(x) {
|
||||
return x.walletId != wallet.id;
|
||||
});
|
||||
txps = txps.concat(status.pendingTxps);
|
||||
txps = formatPendingTxps(txps);
|
||||
console.log('[tab-home.js.120:txps:]',txps); //TODO
|
||||
setPendingTxps(txps);
|
||||
}
|
||||
wallet.status = status;
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ angular.module('copayApp.services').factory('addressbookService', function($stat
|
|||
var root = {};
|
||||
|
||||
root.getLabel = function(addr, cb) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
storageService.getAddressbook(wallet.credentials.network, function(err, ab) {
|
||||
if (!ab) return cb();
|
||||
if (ab[addr]) return cb(ab[addr]);
|
||||
else return cb();
|
||||
storageService.getAddressbook('testnet', function(err, ab) {
|
||||
if (ab && ab[addr]) return cb(ab[addr]);
|
||||
|
||||
storageService.getAddressbook('livnet', function(err, ab) {
|
||||
if (ab && ab[addr]) return cb(ab[addr]);
|
||||
return cb();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -70,13 +70,14 @@ angular.module('copayApp.services')
|
|||
notificationService.newBWCNotification(n,
|
||||
walletId, wallet.credentials.walletName);
|
||||
|
||||
$rootScope.$emit('bwsEvent', wallet.id, n.type, n);
|
||||
|
||||
if (wallet.cacheStatus)
|
||||
wallet.cacheStatus.isValid = false;
|
||||
|
||||
if (wallet.completeHistory)
|
||||
wallet.completeHistory.isValid = false;
|
||||
|
||||
$rootScope.$emit('bwsEvent', wallet.id, n.type, n);
|
||||
});
|
||||
|
||||
wallet.on('walletCompleted', function() {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ angular.module('copayApp.services').factory('txStatus', function($stateParams, l
|
|||
var isCordova = platformInfo.isCordova;
|
||||
|
||||
root.notify = function(txp) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var wallet = profileService.getWallet(txp.walletId);
|
||||
var status = txp.status;
|
||||
var type;
|
||||
var INMEDIATE_SECS = 10;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue