fix scanning status

This commit is contained in:
matiu 2017-09-14 22:09:20 -03:00
commit 1ac368c67d
4 changed files with 21 additions and 13 deletions

View file

@ -224,7 +224,6 @@ angular.module('copayApp.controllers').controller('tabHomeController',
wallet.error = null;
wallet.status = status;
wallet.updating = status && status.wallet && status.wallet.scanStatus == 'running';
// TODO service refactor? not in profile service
profileService.setLastKnownBalance(wallet.id, wallet.status.totalBalanceStr, function() {});
}
@ -243,7 +242,6 @@ angular.module('copayApp.controllers').controller('tabHomeController',
return;
}
wallet.status = status;
wallet.updating = status && status.wallet && status.wallet.scanStatus == 'running';
updateTxps();
});
};

View file

@ -305,6 +305,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
cacheStatus(status);
wallet.scanning = status.wallet && status.wallet.scanStatus == 'running';
return cb(null, status);
});
};
@ -818,13 +820,10 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
$log.debug('Scanning wallet ' + wallet.id);
if (!wallet.isComplete()) return;
wallet.updating = true;
ongoingProcess.set('scanning', true);
wallet.scanning = true;
wallet.startScan({
includeCopayerBranches: true,
}, function(err) {
wallet.updating = false;
ongoingProcess.set('scanning', false);
return cb(err);
});
};