Moved the fix for reading the QR code higher up the call stack, so it would only be used when needed.

This commit is contained in:
Brendon Duncan 2018-05-24 18:56:05 -07:00
commit 576bb2098a
2 changed files with 3 additions and 4 deletions

View file

@ -105,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,10 +11,6 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
root.redir = function(data, shapeshiftData) {
var originalAddress = null;
var noPrefixInAddress = 0;
// Sometimes (testing in Chrome, when reading QR Code) data is an object
// that has a string data.result.
data = data.result || data;
if (data.toLowerCase().indexOf('bitcoin') < 0) {
noPrefixInAddress = 1;