This commit is contained in:
Jean-Baptiste Dominguez 2018-09-03 13:31:58 +09:00
commit 6f28f6ba2b
6 changed files with 84 additions and 111 deletions

View file

@ -3,9 +3,11 @@
angular.module('copayApp.controllers').controller('tabsController', function($rootScope, $log, $scope, $state, $stateParams, $timeout, platformInfo, incomingData, lodash, popupService, gettextCatalog, scannerService, sendFlowService) {
$scope.onScan = function(data) {
if (!incomingData.redir(data)) {
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Invalid data'));
}
incomingData.redir(data, function onError(err) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err.message);
}
});
};
$scope.setScanFn = function(scanFn) {
@ -36,10 +38,14 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
scannerService.useOldScanner(function(err, contents) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
popupService.showAlert(gettextCatalog.getString('Error'), err.message);
} else {
incomingData.redir(contents, function onError(err) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err.message);
}
});
}
incomingData.redir(contents);
});
};