txps refresh WIP

This commit is contained in:
Matias Alejo Garcia 2016-08-23 10:18:43 -03:00
commit ac68106cbf
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
6 changed files with 20 additions and 11 deletions

View file

@ -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();
});
});
};

View file

@ -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() {

View file

@ -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;