Merge pull request #163 from Bitcoin-com/wallet/task/368

Wallet/task/368
This commit is contained in:
Jean-Baptiste Dominguez 2018-06-06 15:43:10 +09:00 committed by GitHub
commit 2e8f277816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 13 deletions

View file

@ -104,12 +104,12 @@ angular.module('copayApp.controllers').controller('searchController', function($
}; };
$scope.searchOnBlockchain = function(searchTerm) { $scope.searchOnBlockchain = function(searchTerm) {
const url = 'https://explorer.bitcoin.com/'+$scope.wallet.coin+'/search/' + searchTerm; var url = 'https://explorer.bitcoin.com/'+$scope.wallet.coin+'/search/' + searchTerm;
const optIn = true; var optIn = true;
const title = null; var title = null;
const message = gettextCatalog.getString('Search on Explorer.Bitcoin.com'); var message = gettextCatalog.getString('Search on Explorer.Bitcoin.com');
const okText = gettextCatalog.getString('Open Explorer'); var okText = gettextCatalog.getString('Open Explorer');
const cancelText = gettextCatalog.getString('Go Back'); var cancelText = gettextCatalog.getString('Go Back');
externalLinkService.open(url, optIn, title, message, okText, cancelText); externalLinkService.open(url, optIn, title, message, okText, cancelText);
}; };

View file

@ -60,11 +60,14 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
}); });
$scope.$on("$ionicView.afterEnter", function() { $scope.$on("$ionicView.afterEnter", function() {
// try initializing and refreshing status any time the view is entered var capabilities = scannerService.getCapabilities();
if(!scannerService.isInitialized()) { if (capabilities.hasPermission) {
scannerService.gentleInitialize(); // try initializing and refreshing status any time the view is entered
if(!scannerService.isInitialized()) {
scannerService.gentleInitialize();
}
activate();
} }
activate();
}); });
function activate(){ function activate(){

View file

@ -1179,12 +1179,13 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
if (signedTxp.status == 'accepted') { if (signedTxp.status == 'accepted') {
ongoingProcess.set('broadcastingTx', true, customStatusHandler); ongoingProcess.set('broadcastingTx', true, customStatusHandler);
function handleBroadcastTx(err, broadcastedTxp) {
var handleBroadcastTx = function(err, broadcastedTxp) {
ongoingProcess.set('broadcastingTx', false, customStatusHandler); ongoingProcess.set('broadcastingTx', false, customStatusHandler);
if (err) return cb(bwcError.msg(err)); if (err) return cb(bwcError.msg(err));
$rootScope.$emit('Local/TxAction', wallet.id); $rootScope.$emit('Local/TxAction', wallet.id);
return cb(null, broadcastedTxp); return cb(null, broadcastedTxp);
} };
if (signedTxp.payProUrl && signedTxp.coin == 'bch') { if (signedTxp.payProUrl && signedTxp.coin == 'bch') {
payproService.broadcastBchTx(signedTxp, handleBroadcastTx); payproService.broadcastBchTx(signedTxp, handleBroadcastTx);