Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
core(cheese): add cheeseTime to constants
Browse files Browse the repository at this point in the history
Change-Id: I4ca28d388e729642a8bbe685b3d49d7fd129ad62
  • Loading branch information
andi34 committed Jan 22, 2022
1 parent 6056840 commit bfe50b4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const photoBooth = (function () {
},
videoView = idVideoView.get(0),
videoPreview = idVideoPreview.get(0),
videoSensor = document.querySelector('#video--sensor');
videoSensor = document.querySelector('#video--sensor'),
cheeseTime = config.picture.no_cheese ? 0 : config.picture.cheese_time;

const PhotoStyle = {
PHOTO: 'photo',
Expand Down Expand Up @@ -417,14 +418,15 @@ const photoBooth = (function () {
api.errorPic({
error: 'No preview by device cam available!'
});
} else if (config.picture.no_cheese) {
photoboothTools.console.log('Cheese is disabled.');
api.takePic(photoStyle, retry);
} else {
api.cheese(photoStyle);
if (config.picture.no_cheese) {
photoboothTools.console.log('Cheese is disabled.');
} else {
api.cheese(photoStyle);
}
setTimeout(() => {
api.takePic(photoStyle, retry);
}, config.picture.cheese_time);
}, cheeseTime);
}
});
};
Expand Down

0 comments on commit bfe50b4

Please sign in to comment.