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

Commit ab1c5ed

Browse files
jacques42andi34
authored andcommitted
core: new timeout only if no activity in progress
Change-Id: Ib8b2557e1753161098b675428436b41f613f6d21
1 parent cf11dd6 commit ab1c5ed

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/js/core.js

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

71-
timeOut = setTimeout(function () {
72-
api.reloadPage();
73-
}, config.picture.time_to_live);
71+
if (!takingPic) {
72+
timeOut = setTimeout(function () {
73+
api.reloadPage();
74+
}, config.picture.time_to_live);
75+
}
7476
};
7577

7678
// reset whole thing
@@ -679,7 +681,6 @@ const photoBooth = (function () {
679681
const chromaimage = config.foldersRoot.keying + '/' + filename;
680682

681683
loader.hide();
682-
api.resetTimeOut();
683684
api.chromaimage = filename;
684685
setMainImage(chromaimage);
685686
};
@@ -688,6 +689,9 @@ const photoBooth = (function () {
688689

689690
takingPic = false;
690691
remoteBuzzerClient.inProgress(false);
692+
693+
api.resetTimeOut();
694+
691695
if (config.dev.enabled) {
692696
console.log('Taking photo:', takingPic);
693697
}
@@ -779,8 +783,6 @@ const photoBooth = (function () {
779783
if (!$('#mySidenav').hasClass('sidenav--open')) {
780784
rotaryController.focusSet('#result');
781785
}
782-
783-
api.resetTimeOut();
784786
};
785787

786788
preloadImage.src = imageUrl;
@@ -790,9 +792,10 @@ const photoBooth = (function () {
790792
}
791793

792794
takingPic = false;
793-
794795
remoteBuzzerClient.inProgress(false);
795796

797+
api.resetTimeOut();
798+
796799
if (config.dev.enabled) {
797800
console.log('Taking photo:', takingPic);
798801
}

0 commit comments

Comments
 (0)