summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2025-12-03 18:25:39 +0700
committeraltaf-creator <dev@altafcreator.com>2025-12-03 18:25:39 +0700
commita0c09a8a9060a49ce2b1dcfeff786e780a62ea05 (patch)
tree83db074c66205a12310b93c8a31d34704e9fdcd9 /frontend
parent603d70b13168af33a04b376224a14b97288debe5 (diff)
arr
Diffstat (limited to 'frontend')
-rw-r--r--frontend/index.html3
-rw-r--r--frontend/start.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/frontend/index.html b/frontend/index.html
index fcb0c2f..8dee2d1 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -38,7 +38,8 @@
<script>
(async () => {
const timers = await fetchTimers();
- if (timers.length > 0) {
+ alert(timers[1]);
+ if (Array.isArray(timers[1]) && timers[1].length > 0) {
window.location.href = './timer/';
} else {
window.location.href = './status/';
diff --git a/frontend/start.js b/frontend/start.js
index c36dc40..50a3485 100644
--- a/frontend/start.js
+++ b/frontend/start.js
@@ -38,7 +38,7 @@ async function requestPermission() {
const existingPanel = document.getElementById("existing-laundry-panel");
const existingText = document.getElementById("existing-laundry-text");
- if (timers[1].length > 0) {
+ if (Array.isArray(timers[1]) && timers[1].length > 0) {
existingPanel.style.display = 'inherit';
if (timers.length == 1) {
existingText.innerText = "You currently have another ongoing laundry. You are creating a new timer.";