mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #2519 from matiaspando/feat/scanStatus
Scanning addresses
This commit is contained in:
commit
7fa97ebc68
|
@ -8,6 +8,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div ng-show="index.walletScanStatus == 'error' && !index.anyOnGoingProcess" ng-click='index.retryScan()'>
|
||||||
|
Scan status finished with error
|
||||||
|
<br> [Tap to retry]
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="size-36" ng-show="!index.anyOnGoingProcess">
|
<div class="size-36" ng-show="!index.anyOnGoingProcess">
|
||||||
<strong>
|
<strong>
|
||||||
|
|
|
@ -50,7 +50,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.isComplete = fc.isComplete();
|
self.isComplete = fc.isComplete();
|
||||||
self.txps = [];
|
self.txps = [];
|
||||||
self.copayers = [];
|
self.copayers = [];
|
||||||
self.setOngoingProcess('scanning', fc.scanning);
|
|
||||||
self.lockedBalance = null;
|
self.lockedBalance = null;
|
||||||
self.totalBalanceStr = null;
|
self.totalBalanceStr = null;
|
||||||
self.notAuthorized = false;
|
self.notAuthorized = false;
|
||||||
|
@ -72,7 +71,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
else {
|
else {
|
||||||
self.updateError = false;
|
self.updateError = false;
|
||||||
return fc.getStatus(function(err, ret) {
|
return fc.getStatus(function(err, ret) {
|
||||||
if (err) self.updateError = true;
|
if (err) {
|
||||||
|
self.updateError = true;
|
||||||
|
} else {
|
||||||
|
self.setOngoingProcess('scanning', ret.wallet.scanning);
|
||||||
|
}
|
||||||
return cb(err, ret);
|
return cb(err, ret);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -97,6 +100,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.walletName = walletStatus.wallet.name;
|
self.walletName = walletStatus.wallet.name;
|
||||||
self.walletSecret = walletStatus.wallet.secret;
|
self.walletSecret = walletStatus.wallet.secret;
|
||||||
self.walletStatus = walletStatus.wallet.status;
|
self.walletStatus = walletStatus.wallet.status;
|
||||||
|
self.walletScanStatus = walletStatus.wallet.scanStatus;
|
||||||
self.copayers = walletStatus.wallet.copayers;
|
self.copayers = walletStatus.wallet.copayers;
|
||||||
self.setBalance(walletStatus.balance);
|
self.setBalance(walletStatus.balance);
|
||||||
});
|
});
|
||||||
|
@ -369,9 +373,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
go.swipe();
|
go.swipe();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.retryScan = function() {
|
||||||
|
var self = this;
|
||||||
|
self.startScan(self.walletId);
|
||||||
|
}
|
||||||
|
|
||||||
self.startScan = function(walletId) {
|
self.startScan = function(walletId) {
|
||||||
var c = profileService.walletClients[walletId];
|
var c = profileService.walletClients[walletId];
|
||||||
c.scanning = true;
|
|
||||||
|
|
||||||
if (self.walletId == walletId)
|
if (self.walletId == walletId)
|
||||||
self.setOngoingProcess('scanning', true);
|
self.setOngoingProcess('scanning', true);
|
||||||
|
@ -380,7 +388,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
includeCopayerBranches: true,
|
includeCopayerBranches: true,
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
c.scanning = false;
|
|
||||||
if (self.walletId == walletId)
|
if (self.walletId == walletId)
|
||||||
self.setOngoingProcess('scanning', false);
|
self.setOngoingProcess('scanning', false);
|
||||||
self.clientError = 'Could not scan wallet:' + err;
|
self.clientError = 'Could not scan wallet:' + err;
|
||||||
|
@ -467,22 +474,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.swipeRight = true;
|
self.swipeRight = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
lodash.each(['NewIncomingTx', 'ScanFinished'], function(eventName) {
|
|
||||||
$rootScope.$on(eventName, function() {
|
$rootScope.$on('NewIncomingTx', function() {
|
||||||
if (eventName == 'ScanFinished') {
|
self.updateBalance();
|
||||||
self.setOngoingProcess('scanning', false);
|
$timeout(function() {
|
||||||
}
|
self.updateTxHistory();
|
||||||
self.updateBalance();
|
}, 5000);
|
||||||
$timeout(function() {
|
|
||||||
self.updateTxHistory();
|
|
||||||
}, 5000);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// remove transactionProposalRemoved (only for compat)
|
// remove transactionProposalRemoved (only for compat)
|
||||||
|
|
||||||
lodash.each(['NewOutgoingTx', 'NewTxProposal', 'TxProposalFinallyRejected', 'transactionProposalRemoved', 'TxProposalRemoved',
|
lodash.each(['NewOutgoingTx', 'NewTxProposal', 'TxProposalFinallyRejected', 'transactionProposalRemoved', 'TxProposalRemoved',
|
||||||
'Local/NewTxProposal', 'Local/TxProposalAction'
|
'Local/NewTxProposal', 'Local/TxProposalAction', 'ScanFinished'
|
||||||
], function(eventName) {
|
], function(eventName) {
|
||||||
$rootScope.$on(eventName, function() {
|
$rootScope.$on(eventName, function() {
|
||||||
self.updateAll();
|
self.updateAll();
|
||||||
|
|
|
@ -79,11 +79,6 @@ angular.module('copayApp.services')
|
||||||
notificationService.newBWCNotification(n,
|
notificationService.newBWCNotification(n,
|
||||||
client.credentials.walletId, client.credentials.walletName);
|
client.credentials.walletId, client.credentials.walletName);
|
||||||
|
|
||||||
// Actions for both focuses and unfocuses wallets...
|
|
||||||
if (n.type == 'ScanFinished') {
|
|
||||||
client.scanning = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
|
if (root.focusedClient.credentials.walletId == client.credentials.walletId) {
|
||||||
$rootScope.$emit(n.type);
|
$rootScope.$emit(n.type);
|
||||||
} else {
|
} else {
|
||||||
|
@ -359,11 +354,11 @@ angular.module('copayApp.services')
|
||||||
return cb('Wrong password');
|
return cb('Wrong password');
|
||||||
}
|
}
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
if( fc.isPrivKeyEncrypted()) {
|
if (fc.isPrivKeyEncrypted()) {
|
||||||
$log.debug('Locking wallet automatically');
|
$log.debug('Locking wallet automatically');
|
||||||
root.lockFC();
|
root.lockFC();
|
||||||
};
|
};
|
||||||
},2000);
|
}, 2000);
|
||||||
return cb();
|
return cb();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue