fix: hide in footer if commit hash is unknown

This commit is contained in:
Maya 2025-11-24 09:24:16 +03:00
parent 3e8f86ec35
commit a1b0b15332
No known key found for this signature in database
1 changed files with 8 additions and 1 deletions

View File

@ -2,11 +2,18 @@
import { GITHUB_URL_VERT, DISCORD_URL } from "$lib/util/consts"; import { GITHUB_URL_VERT, DISCORD_URL } from "$lib/util/consts";
import { m } from "$lib/paraglide/messages"; import { m } from "$lib/paraglide/messages";
const commitHash =
__COMMIT_HASH__ && __COMMIT_HASH__ !== "unknown"
? __COMMIT_HASH__
: null;
const items = $derived([ const items = $derived([
[m["footer.source_code"](), GITHUB_URL_VERT], [m["footer.source_code"](), GITHUB_URL_VERT],
[m["footer.discord_server"](), DISCORD_URL], [m["footer.discord_server"](), DISCORD_URL],
[m["footer.privacy_policy"](), "/privacy"], [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(); const year = new Date().getFullYear();