fix: translate posts target language is not current selected language (#1263)

This commit is contained in:
Alex 2023-01-18 05:41:26 +08:00 committed by GitHub
parent a7e1dad3d2
commit 0b77ad3f43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 21 deletions

View file

@ -9,7 +9,7 @@ const {
toggle: _toggleTranslation,
translation,
enabled: isTranslationEnabled,
} = useTranslation(status)
} = useTranslation(status, getLanguageCode())
let translating = $ref(false)
const toggleTranslation = async () => {
@ -26,7 +26,7 @@ const toggleTranslation = async () => {
<template>
<div>
<button
v-if="isTranslationEnabled && status.language !== languageCode" p-0 flex="~ center" gap-2 text-sm
v-if="isTranslationEnabled && status.language !== getLanguageCode()" p-0 flex="~ center" gap-2 text-sm
:disabled="translating" disabled-bg-transparent btn-text class="disabled-text-$c-text-btn-disabled-deeper" @click="toggleTranslation"
>
<span v-if="translating" block animate-spin preserve-3d>