From 66c57e8aa6cabfa089a43895e88a4f7e326e8226 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 7 Jan 2024 12:42:48 +0100 Subject: [PATCH] Fix Freeze --- src/components/admin/pages/event/FightList.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/admin/pages/event/FightList.svelte b/src/components/admin/pages/event/FightList.svelte index 3cfc3e4..63d38be 100644 --- a/src/components/admin/pages/event/FightList.svelte +++ b/src/components/admin/pages/event/FightList.svelte @@ -155,7 +155,7 @@ $: minTime = dayjs(Math.min(...fights.map(fight => fight.start))).utc(true); let changeTimeOpen = false; - let changedTime = dayjs(Math.min(...fights.map(fight => fight.start), 0))?.utc(true).toISOString()?.slice(0, -1); + let changedTime = fights.length != 0 ? dayjs(Math.min(...fights.map(fight => fight.start)))?.utc(true)?.toISOString()?.slice(0, -1) : undefined; $: deltaTime = dayjs.duration(dayjs(changedTime).utc(true).diff(minTime)) @@ -194,7 +194,7 @@ Reschedule Fights - selectedFights.size > 0 ? kampfleiterOpen = true : kampfleiterOpen = false}> + selectedFights.size > 0 ? kampfleiterOpen = true : kampfleiterOpen = false} disabled={changedTime === undefined}> Change Kampfleiter