diff --git a/src/js/core.js b/src/js/core.js index d25d68a53..bb7d0abcf 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -68,9 +68,11 @@ const photoBooth = (function () { api.resetTimeOut = function () { clearTimeout(timeOut); - timeOut = setTimeout(function () { - api.reloadPage(); - }, config.picture.time_to_live); + if (!takingPic) { + timeOut = setTimeout(function () { + api.reloadPage(); + }, config.picture.time_to_live); + } }; // reset whole thing @@ -328,6 +330,10 @@ const photoBooth = (function () { takingPic = true; + if (api.isTimeOutPending()) { + api.resetTimeOut(); + } + if (config.dev.enabled) { console.log('Taking photo:', takingPic); } @@ -679,7 +685,6 @@ const photoBooth = (function () { const chromaimage = config.foldersRoot.keying + '/' + filename; loader.hide(); - api.resetTimeOut(); api.chromaimage = filename; setMainImage(chromaimage); }; @@ -688,6 +693,9 @@ const photoBooth = (function () { takingPic = false; remoteBuzzerClient.inProgress(false); + + api.resetTimeOut(); + if (config.dev.enabled) { console.log('Taking photo:', takingPic); } @@ -779,8 +787,6 @@ const photoBooth = (function () { if (!$('#mySidenav').hasClass('sidenav--open')) { rotaryController.focusSet('#result'); } - - api.resetTimeOut(); }; preloadImage.src = imageUrl; @@ -790,9 +796,10 @@ const photoBooth = (function () { } takingPic = false; - remoteBuzzerClient.inProgress(false); + api.resetTimeOut(); + if (config.dev.enabled) { console.log('Taking photo:', takingPic); }