diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index cf39167743..52e0cb6ba9 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -6,7 +6,7 @@ - ### Client -- +- Fix: 翻訳が成功しても翻訳中のままになるのを修正 [#415](https://github.com/yojo-art/cherrypick/pull/415) ### Server - diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 511459f716..06bb3eb212 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -744,6 +744,7 @@ async function translate(): Promise { text: err.id, }); }); + translating.value = false; translation.value = res; vibrate(defaultStore.state.vibrateSystem ? [5, 5, 10] : []); diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 51677fe244..86ba25c6ea 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -680,6 +680,7 @@ async function translate(): Promise { text: err.id, }); }); + translating.value = false; translation.value = res; vibrate(defaultStore.state.vibrateSystem ? [5, 5, 10] : []); diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue index 926be97cf4..47057d990c 100644 --- a/packages/frontend/src/components/MkSubNoteContent.vue +++ b/packages/frontend/src/components/MkSubNoteContent.vue @@ -453,6 +453,7 @@ async function translate(): Promise { text: err.id, }); }); + translating.value = false; translation.value = res; vibrate(defaultStore.state.vibrateSystem ? [5, 5, 10] : []); diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index 041eeb5b93..cf02724967 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -347,6 +347,7 @@ async function translate(): Promise { text: err.id, }); }); + translating.value = false; translation.value = res; vibrate(defaultStore.state.vibrateSystem ? [5, 5, 10] : []); diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 232678acdd..b12d1e643c 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -340,6 +340,14 @@ export function getNoteMenu(props: { const res = await misskeyApi('notes/translate', { noteId: appearNote.id, targetLang: miLocalStorage.getItem('lang') ?? navigator.language, + }).catch((err) => { + props.translating.value = false; + os.alert( + { + type: 'error', + title: err.message, + text: err.id, + }); }); props.translating.value = false; props.translation.value = res;