From 50de29284f9acb7ea3f0838ae8f23b2303d33381 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 13:50:34 +0100 Subject: [PATCH] disable reload on ergo page; allow camera capture --- frontend/main.ts | 24 +++++++++++++----------- templates/ergo.html.tera | 4 ++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/frontend/main.ts b/frontend/main.ts index 640f60a..625abd6 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -68,19 +68,21 @@ function selectBoatChange() { } function reloadPage() { - let pageTitle = document.title; - let attentionMessage = 'Riemen- und Dollenbruch'; + if (!window.location.href.includes("ergo")){ + let pageTitle = document.title; + let attentionMessage = 'Riemen- und Dollenbruch'; - document.addEventListener('visibilitychange', function() { - let isPageActive = !document.hidden; + document.addEventListener('visibilitychange', function() { + let isPageActive = !document.hidden; - if(!isPageActive){ - document.title = attentionMessage; - } else { - document.title = pageTitle; - location.reload(); - } - }); + if(!isPageActive){ + document.title = attentionMessage; + } else { + document.title = pageTitle; + location.reload(); + } + }); + } } function setMaxAmountRowers(name: string, rowers: number) { diff --git a/templates/ergo.html.tera b/templates/ergo.html.tera index 3d172a6..3385611 100644 --- a/templates/ergo.html.tera +++ b/templates/ergo.html.tera @@ -37,7 +37,7 @@ {% endfor %} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} - + @@ -61,7 +61,7 @@ {% endfor %} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} - +