From 66c05c9583dcfa9a63cdfd9601b3f8d7852b43d7 Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Tue, 18 Jun 2024 12:30:54 -0400 Subject: [PATCH] fix tournament + match titles more --- src/routes/(app)/match/+page.svelte | 4 +++- src/routes/(app)/tournament/+page.svelte | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/routes/(app)/match/+page.svelte b/src/routes/(app)/match/+page.svelte index a415101..53b5abc 100644 --- a/src/routes/(app)/match/+page.svelte +++ b/src/routes/(app)/match/+page.svelte @@ -264,9 +264,11 @@ tournamentId = params.get('tournament') ?? undefined; seasonIdx = Number(params.get('season') ?? '1') - 1; bracketIdx = Number(params.get('bracket') ?? '1') - 1; - matchIdx = Number(params.get('idx') ?? '1') - 1; + matchIdx = Number(params.get('idx') ?? NaN); if (isNaN(matchIdx)) { matchIdx = undefined; + } else { + matchIdx -= 1; } matchId = params.get('match') ?? undefined; } diff --git a/src/routes/(app)/tournament/+page.svelte b/src/routes/(app)/tournament/+page.svelte index 53b69a1..0e7bc78 100644 --- a/src/routes/(app)/tournament/+page.svelte +++ b/src/routes/(app)/tournament/+page.svelte @@ -66,9 +66,12 @@ import { page } from "$app/stores"; function parseQueryParams(params: URLSearchParams): void { tournamentId = params.get('id') ?? undefined; seasonIdx = Number(params.get('season') ?? '1') - 1; - tournamentIdx = Number(params.get('idx') ?? '1') - 1; + tournamentIdx = Number(params.get('idx') ?? NaN); + console.log(tournamentIdx); if (isNaN(tournamentIdx)) { tournamentIdx = undefined; + } else { + tournamentIdx -= 1; } }