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

Commit e7323c2

Browse files
committed
core: new timeout only if no activity in progress
1 parent 8d1215c commit e7323c2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/js/core.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ const photoBooth = (function () {
6969
api.resetTimeOut = function () {
7070
clearTimeout(timeOut);
7171

72-
timeOut = setTimeout(function () {
73-
api.reloadPage();
74-
}, timeToLive);
72+
if (!takingPic) {
73+
timeOut = setTimeout(function () {
74+
api.reloadPage();
75+
}, timeToLive);
76+
}
7577
};
7678

7779
// reset whole thing
@@ -780,8 +782,6 @@ const photoBooth = (function () {
780782
if (!$('#mySidenav').hasClass('sidenav--open')) {
781783
rotaryController.focusSet('#result');
782784
}
783-
784-
api.resetTimeOut();
785785
};
786786

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

793793
takingPic = false;
794794

795+
api.resetTimeOut();
796+
795797
remoteBuzzerClient.inProgress(false);
796798

797799
if (config.dev.enabled) {

0 commit comments

Comments
 (0)