From cbba846c4faba09819c782e0d3c378f7c382d1e1 Mon Sep 17 00:00:00 2001 From: Alex <49969959+alexzhang1030@users.noreply.github.com> Date: Fri, 28 Apr 2023 15:36:05 +0800 Subject: [PATCH] fix: translation button still display when posts have no contents (#2027) --- components/status/StatusTranslation.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/status/StatusTranslation.vue b/components/status/StatusTranslation.vue index 4334b084..97d00c40 100644 --- a/components/status/StatusTranslation.vue +++ b/components/status/StatusTranslation.vue @@ -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() {