Seasonpicks: Disable countdown until seasonpicks will be locked
All checks were successful
Build Formula11 Docker Image / pocketbase-docker (push) Successful in 28s

This commit is contained in:
2025-03-14 01:45:57 +01:00
parent b9413fcfcd
commit 082bb72ec1
3 changed files with 17 additions and 1 deletions

View File

@ -18,6 +18,9 @@
<!-- Prefetch data specified in "load" functions on link hover -->
<body data-theme="formula11Theme" data-sveltekit-preload-data="hover">
<!-- SvelteKit inserts the body contents here -->
<div style="display: contents; user-select: none; -moz-user-select: none">%sveltekit.body%</div>
<!-- TODO: The fucking user-select: none doesn't work in firefox -->
<div style="display: contents; user-select: none; -moz-user-select: -moz-none">
%sveltekit.body%
</div>
</body>
</html>

View File

@ -22,6 +22,7 @@
TEAM_BANNER_HEIGHT,
TEAM_BANNER_WIDTH,
} from "$lib/config";
import Countdown from "$lib/components/Countdown.svelte";
let { data }: { data: PageData } = $props();
@ -481,3 +482,13 @@
{/await}
</div>
</div>
{#await Promise.all([data.seasonpicks, data.currentrace]) then [seasonpicks, currentrace]}
{#if seasonpicks.length <= 0 && currentrace}
<div class="card mx-auto w-fit p-2 shadow">
<span class="mr-2 text-xl font-medium">Season pick modification will be locked in</span>
<Countdown date={currentrace.qualidate} gotext="0d 0h 0m" extraclass="font-bold text-xl" />
<span class="ml-2 text-xl font-medium">.</span>
</div>
{/if}
{/await}

View File

@ -5,6 +5,7 @@ import {
fetch_seasonpickedusers,
fetch_visibleseasonpicks,
fetch_teams,
fetch_currentrace,
} from "$lib/fetch";
import type { PageLoad } from "../$types";
@ -17,6 +18,7 @@ export const load: PageLoad = async ({ fetch, depends }) => {
seasonpicks: fetch_visibleseasonpicks(fetch),
hottakes: fetch_hottakes(fetch),
seasonpickedusers: fetch_seasonpickedusers(fetch),
currentrace: fetch_currentrace(fetch), // Used for countdown
seasonpick: await fetch_currentseasonpick(fetch),
};