add old scanner for windows platform
This commit is contained in:
parent
f6245652d9
commit
8627e60103
7 changed files with 121 additions and 62 deletions
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabsController', function($rootScope, $log, $scope, $state, $stateParams, $timeout, incomingData, lodash, popupService, gettextCatalog) {
|
||||
angular.module('copayApp.controllers').controller('tabsController', function($rootScope, $log, $scope, $state, $stateParams, $timeout, platformInfo, incomingData, lodash, popupService, gettextCatalog, scannerService) {
|
||||
|
||||
$scope.onScan = function(data) {
|
||||
if (!incomingData.redir(data)) {
|
||||
|
|
@ -22,6 +22,25 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
|
|||
}, 1);
|
||||
};
|
||||
|
||||
$scope.chooseScanner = function() {
|
||||
|
||||
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
|
||||
|
||||
if (!isWindowsPhoneApp) {
|
||||
$state.go('tabs.scan');
|
||||
return;
|
||||
}
|
||||
|
||||
scannerService.useOldScanner(function(err, contents) {
|
||||
if (err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
return;
|
||||
}
|
||||
incomingData.redir(contents);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$rootScope.hideTabs = '';
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue