Fix QR scanner from directive

This commit is contained in:
Gustavo Maximiliano Cortez 2017-01-04 20:43:04 -03:00
commit 2e82dfa0a8
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
4 changed files with 13 additions and 6 deletions

View file

@ -20,12 +20,17 @@ angular.module('copayApp.directives')
$state.go('scanner', { passthroughMode: 1 });
};
$rootScope.$on('$ionicView.afterEnter', function() {
var afterEnter = $rootScope.$on('$ionicView.afterEnter', function() {
if($rootScope.scanResult) {
scope.onScan({ data: $rootScope.scanResult });
$rootScope.scanResult = null;
}
});
// Destroy event
scope.$on('$destroy', function(){
afterEnter();
});
}
}
});