From 21028985b25235e98dd8241b94888f54e5be6ffd Mon Sep 17 00:00:00 2001 From: Vilsol Date: Fri, 20 Oct 2023 01:01:24 +0300 Subject: [PATCH] fix: check if state exists --- .../mods/compatibility/CompatibilityStateText.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/components/mods/compatibility/CompatibilityStateText.svelte b/src/lib/components/mods/compatibility/CompatibilityStateText.svelte index 1f6cae73e..51cc2c633 100644 --- a/src/lib/components/mods/compatibility/CompatibilityStateText.svelte +++ b/src/lib/components/mods/compatibility/CompatibilityStateText.svelte @@ -5,7 +5,12 @@ export const { t } = getTranslate(); + const textForState = state ?? ('Unknown' as CompatibilityState); const classForState = (s: CompatibilityState): string => `mod-state-${s.toString().toLowerCase()}`; -

{$t(`compatibility-info.state.${state.toString().toLowerCase()}`)}

+{#if state} +

+ {$t(`compatibility-info.state.${textForState.toString().toLowerCase()}`)} +

+{/if}