fix: translation button still display when posts have no contents (#2027)

pull/2029/head
Alex 2023-04-28 15:36:05 +08:00 zatwierdzone przez GitHub
rodzic 574d72af61
commit cbba846c4f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -12,7 +12,11 @@ const {
} = useTranslation(status, getLanguageCode())
const preferenceHideTranslation = usePreferences('hideTranslation')
const showButton = computed(() => !preferenceHideTranslation.value && isTranslationEnabled)
const showButton = computed(() =>
!preferenceHideTranslation.value
&& isTranslationEnabled
&& status.content.trim().length,
)
let translating = $ref(false)
async function toggleTranslation() {