From 4b3d8836396150eed0903da0f0e17e5bd048ed6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 23 Oct 2017 13:49:33 +0200 Subject: [PATCH] Don't evaluate onWebcamLoaded more than once Firefox for some reason keeps triggering the event and we don't want to do unnecessary work on each trigger (and flood the log with debug statements). --- src/octoprint/static/js/app/viewmodels/control.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/octoprint/static/js/app/viewmodels/control.js b/src/octoprint/static/js/app/viewmodels/control.js index 3e5d24b8..4950af7b 100644 --- a/src/octoprint/static/js/app/viewmodels/control.js +++ b/src/octoprint/static/js/app/viewmodels/control.js @@ -402,6 +402,8 @@ $(function() { }; self.onWebcamLoaded = function() { + if (self.webcamLoaded()) return; + log.debug("Webcam stream loaded"); self.webcamLoaded(true); self.webcamError(false);