commit
1e628d9704
7 changed files with 116 additions and 3 deletions
10
src/js/controllers/modals/receiveTips.js
Normal file
10
src/js/controllers/modals/receiveTips.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('receiveTipsController', function($scope, $log, storageService) {
|
||||
$scope.close = function() {
|
||||
$log.debug('Receive tips accepted');
|
||||
storageService.setReceiveTipsAccepted(true, function(err) {
|
||||
$scope.receiveTipsModal.hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
11
src/js/controllers/modals/scanTips.js
Normal file
11
src/js/controllers/modals/scanTips.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('scanTipsController', function($scope, $log, storageService) {
|
||||
$scope.close = function() {
|
||||
$log.debug('Scan tips accepted');
|
||||
storageService.setScanTipsAccepted(true, function(err) {
|
||||
$scope.$emit('TipsModalClosed', function() {});
|
||||
$scope.scanTipsModal.hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('scannerController', function($scope, $timeout) {
|
||||
angular.module('copayApp.controllers').controller('scannerController', function($scope, $timeout, storageService, $ionicModal, platformInfo) {
|
||||
|
||||
// QR code Scanner
|
||||
var video;
|
||||
|
|
@ -73,6 +73,35 @@ angular.module('copayApp.controllers').controller('scannerController', function(
|
|||
};
|
||||
|
||||
$scope.init = function() {
|
||||
if (platformInfo.isCordova) scannerInit();
|
||||
else checkTips();
|
||||
};
|
||||
|
||||
function checkTips() {
|
||||
//TODO addapt tips to the new QR plugin (mobile)
|
||||
storageService.getScanTipsAccepted(function(err, accepted) {
|
||||
if (err) $log.warn(err);
|
||||
if (accepted) {
|
||||
scannerInit();
|
||||
return;
|
||||
}
|
||||
|
||||
$timeout(function() {
|
||||
$ionicModal.fromTemplateUrl('views/modals/scan-tips.html', {
|
||||
scope: $scope
|
||||
}).then(function(modal) {
|
||||
$scope.scanTipsModal = modal;
|
||||
$scope.scanTipsModal.show();
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on('TipsModalClosed', function(event) {
|
||||
scannerInit();
|
||||
});
|
||||
|
||||
function scannerInit() {
|
||||
setScanner();
|
||||
$timeout(function() {
|
||||
if ($scope.beforeScan) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue