Skip to content

Commit

Permalink
fix karma tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrion committed Aug 13, 2018
1 parent 59efb47 commit 377da95
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions www/scripts/controllers/colorPickerController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ app.controller('colorPickerController', function($scope, $translate) {
console.log('ColorPickerController');
var that = this;

var permissions = cordova.plugins.permissions;
if (typeof cordova !== 'undefined') {
var permissions = cordova.plugins.permissions;
}

this.resizeVideo = function() {
$scope.canvas.height = window.innerHeight - 44;
Expand Down Expand Up @@ -153,22 +155,24 @@ app.controller('colorPickerController', function($scope, $translate) {
navigatorMain.on('prepop', $scope.stopTalking);

// Load media stream
permissions.checkPermission(permissions.CAMERA, function(status) {
if (status.hasPermission) {
$scope.requestVideo();
} else {
permissions.requestPermission(permissions.CAMERA, function(status) {
if (status.hasPermission) {
$scope.requestVideo();
} else {
if (permissions) {
permissions.checkPermission(permissions.CAMERA, function(status) {
if (status.hasPermission) {
$scope.requestVideo();
} else {
permissions.requestPermission(permissions.CAMERA, function(status) {
if (status.hasPermission) {
$scope.requestVideo();
} else {
navigatorMain.popPage();
}
}, function() {
navigatorMain.popPage();
}
}, function() {
navigatorMain.popPage();
});
}
}, function() {
navigatorMain.popPage();
});
});
}
}, function() {
navigatorMain.popPage();
});
}
};
});

0 comments on commit 377da95

Please sign in to comment.