From ff9c481c38f3c5b81cdead353439cb6c8d26d394 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 30 Dec 2024 17:32:36 -0500 Subject: [PATCH] Hide injection of selected language under if Lingo doesn't implement selecting a language --- .../components/tree/PresentationControls.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arches_references/src/arches_references/components/tree/PresentationControls.vue b/arches_references/src/arches_references/components/tree/PresentationControls.vue index f4b3359..26c86fc 100644 --- a/arches_references/src/arches_references/components/tree/PresentationControls.vue +++ b/arches_references/src/arches_references/components/tree/PresentationControls.vue @@ -16,14 +16,18 @@ import { shouldUseContrast } from "@/arches_references/utils.ts"; import type { Ref } from "vue"; import type { Language } from "@/arches_vue_utils/types"; -const { $gettext } = useGettext(); - -const selectedLanguage = inject(selectedLanguageKey) as Ref; - const { expandAll, collapseAll } = defineProps<{ expandAll: () => void; collapseAll: () => void; }>(); + +let selectedLanguage: Ref | undefined; +if (arches.languages) { + // arches-lingo reuses this component without this provided. + selectedLanguage = inject(selectedLanguageKey); +} + +const { $gettext } = useGettext();