Make beforeScan optional
This commit is contained in:
parent
1f4f78bec0
commit
496b88cc0e
1 changed files with 6 additions and 2 deletions
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue