From a1b0b15332dc31efc6dba38b979f34e9da6371fd Mon Sep 17 00:00:00 2001 From: Maya Date: Mon, 24 Nov 2025 09:24:16 +0300 Subject: [PATCH] fix: hide in footer if commit hash is unknown --- src/lib/components/layout/Footer.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/components/layout/Footer.svelte b/src/lib/components/layout/Footer.svelte index 419bbcd..0425caa 100644 --- a/src/lib/components/layout/Footer.svelte +++ b/src/lib/components/layout/Footer.svelte @@ -2,11 +2,18 @@ import { GITHUB_URL_VERT, DISCORD_URL } from "$lib/util/consts"; import { m } from "$lib/paraglide/messages"; + const commitHash = + __COMMIT_HASH__ && __COMMIT_HASH__ !== "unknown" + ? __COMMIT_HASH__ + : null; + const items = $derived([ [m["footer.source_code"](), GITHUB_URL_VERT], [m["footer.discord_server"](), DISCORD_URL], [m["footer.privacy_policy"](), "/privacy"], - [__COMMIT_HASH__, `${GITHUB_URL_VERT}/commit/${__COMMIT_HASH__}`] + ...(commitHash + ? [[commitHash, `${GITHUB_URL_VERT}/commit/${commitHash}`]] + : []), ]); const year = new Date().getFullYear();