Make beforeScan optional

This commit is contained in:
Kosta Korenkov 2015-07-23 13:52:00 +03:00
parent 1f4f78bec0
commit 496b88cc0e
1 changed files with 6 additions and 2 deletions

View File

@ -31,7 +31,9 @@ angular.module('copayApp.directives')
alert('Scanning error');
}
);
$scope.beforeScan();
if ($scope.beforeScan) {
$scope.beforeScan();
}
}, 100);
};
@ -90,7 +92,9 @@ angular.module('copayApp.directives')
$scope.init = function() {
setScanner();
$timeout(function() {
parentScope.beforeScan();
if (parentScope.beforeScan) {
parentScope.beforeScan();
}
canvas = document.getElementById('qr-canvas');
context = canvas.getContext('2d');