Merge pull request #144 from Bitcoin-com/wallet/task/357

Wallet/task/357
This commit is contained in:
Jean-Baptiste Dominguez 2018-05-25 11:55:36 +09:00 committed by GitHub
commit ae38e6efbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -61,7 +61,10 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
$scope.$on("$ionicView.afterEnter", function() {
// try initializing and refreshing status any time the view is entered
scannerService.gentleInitialize();
if(!scannerService.isInitialized()) {
scannerService.gentleInitialize();
}
activate();
});
function activate(){
@ -102,6 +105,9 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
function handleSuccessfulScan(contents){
$log.debug('Scan returned: "' + contents + '"');
scannerService.pausePreview();
// Sometimes (testing in Chrome, when reading QR Code) data is an object
// that has a string data.result.
contents = contents.result || contents;
incomingData.redir(contents);
}

View file

@ -11,7 +11,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
root.redir = function(data, shapeshiftData) {
var originalAddress = null;
var noPrefixInAddress = 0;
if (data.toLowerCase().indexOf('bitcoin') < 0) {
noPrefixInAddress = 1;
}