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

Commit

Permalink
core: new timeout only if no activity in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jacques42 committed Aug 1, 2021
1 parent 8d1215c commit e7323c2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ const photoBooth = (function () {
api.resetTimeOut = function () {
clearTimeout(timeOut);

timeOut = setTimeout(function () {
api.reloadPage();
}, timeToLive);
if (!takingPic) {
timeOut = setTimeout(function () {
api.reloadPage();
}, timeToLive);
}
};

// reset whole thing
Expand Down Expand Up @@ -780,8 +782,6 @@ const photoBooth = (function () {
if (!$('#mySidenav').hasClass('sidenav--open')) {
rotaryController.focusSet('#result');
}

api.resetTimeOut();
};

preloadImage.src = imageUrl;
Expand All @@ -792,6 +792,8 @@ const photoBooth = (function () {

takingPic = false;

api.resetTimeOut();

remoteBuzzerClient.inProgress(false);

if (config.dev.enabled) {
Expand Down

0 comments on commit e7323c2

Please sign in to comment.