stop scanning after user navigates via the incoming data menu

This commit is contained in:
Marty Alcala 2016-10-18 17:13:42 -04:00
parent fb4810da0c
commit 353aa46575
2 changed files with 8 additions and 9 deletions

View File

@ -62,6 +62,7 @@ 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();
scannerService.resumePreview();
});
function activate(){

View File

@ -17,26 +17,24 @@ angular.module('copayApp.directives')
});
scope.hide = function() {
scope.showMenu = false;
$rootScope.$broadcast('incomingDataMenu.menuHidden');
};
scope.sendPaymentToAddress = function(bitcoinAddress) {
scope.hide();
scope.showMenu = false;
$state.go('tabs.send');
$timeout(function() {
$state.transitionTo('tabs.send.amount', {toAddress: bitcoinAddress});
}, 100);
};
scope.addToAddressBook = function(bitcoinAddress) {
scope.hide();
$state.go('tabs.send');
scope.showMenu = false;
$timeout(function() {
$state.transitionTo('tabs.send.addressbook', {addressbookEntry: bitcoinAddress});
$state.go('tabs.send');
$timeout(function() {
$state.transitionTo('tabs.send.addressbook', {addressbookEntry: bitcoinAddress});
});
}, 100);
};
scope.$watch('showMenu', function() {
if(!scope.showMenu) {
$rootScope.$broadcast('incomingDataMenu.menuHidden');
}
});
}
};
});