From 0d34b4d2f74e36d9383a8164d3706b5a6b29cf77 Mon Sep 17 00:00:00 2001 From: Marty Alcala Date: Tue, 18 Oct 2016 17:38:47 -0400 Subject: [PATCH] ensure scan view resumes on action sheet close --- src/js/controllers/tab-scan.js | 1 + src/js/directives/actionSheet.js | 3 ++- src/js/directives/incomingDataMenu.js | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/tab-scan.js b/src/js/controllers/tab-scan.js index 3f14ebfa3..beb46397c 100644 --- a/src/js/controllers/tab-scan.js +++ b/src/js/controllers/tab-scan.js @@ -105,6 +105,7 @@ angular.module('copayApp.controllers').controller('tabScanController', function( } $rootScope.$on('incomingDataMenu.menuHidden', function() { + console.log('in herererere'); scannerService.resumePreview(); activate(); }); diff --git a/src/js/directives/actionSheet.js b/src/js/directives/actionSheet.js index 4ca9fddb0..646072849 100644 --- a/src/js/directives/actionSheet.js +++ b/src/js/directives/actionSheet.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.directives') - .directive('actionSheet', function() { + .directive('actionSheet', function($rootScope) { return { restrict: 'E', templateUrl: 'views/includes/actionSheet.html', @@ -12,6 +12,7 @@ angular.module('copayApp.directives') link: function(scope, element, attrs) { scope.hide = function() { scope.show = false; + $rootScope.$broadcast('incomingDataMenu.menuHidden'); }; } }; diff --git a/src/js/directives/incomingDataMenu.js b/src/js/directives/incomingDataMenu.js index e856aa468..049ac8e21 100644 --- a/src/js/directives/incomingDataMenu.js +++ b/src/js/directives/incomingDataMenu.js @@ -22,14 +22,18 @@ angular.module('copayApp.directives') scope.sendPaymentToAddress = function(bitcoinAddress) { scope.showMenu = false; $state.go('tabs.send').then(function() { - $state.transitionTo('tabs.send.amount', {toAddress: bitcoinAddress}); + $timeout(function() { + $state.transitionTo('tabs.send.amount', {toAddress: bitcoinAddress}); + }, 50); }); }; scope.addToAddressBook = function(bitcoinAddress) { scope.showMenu = false; $timeout(function() { $state.go('tabs.send').then(function() { - $state.transitionTo('tabs.send.addressbook', {addressbookEntry: bitcoinAddress}); + $timeout(function() { + $state.transitionTo('tabs.send.addressbook', {addressbookEntry: bitcoinAddress}); + }, 10); }); }, 100); };