Don't show language selector when it's not needed (#14244)

This commit is contained in:
Jan-Willem
2022-07-01 16:55:27 +02:00
committed by GitHub
parent 7b16abdcac
commit 4a95fb96d2

View File

@@ -1,7 +1,7 @@
<template>
<div class="translations" :class="{ split: splitViewEnabled }">
<div class="primary" :class="splitViewEnabled ? 'half' : 'full'">
<language-select v-model="firstLang" :items="languageOptions">
<language-select v-if="showLanguageSelect" v-model="firstLang" :items="languageOptions">
<template #append>
<v-icon
v-if="splitViewAvailable && !splitViewEnabled"
@@ -185,6 +185,10 @@ const splitViewEnabled = computed(() => {
return splitViewAvailable.value && splitView.value;
});
const showLanguageSelect = computed(() => {
return languageOptions.value.length > 1;
});
function useLanguages() {
const languages = ref<Record<string, any>[]>([]);
const loading = ref(false);