From 75314035fca1e4b8fafb41977c36664d41fae04a Mon Sep 17 00:00:00 2001 From: pen <121443048+penginn-net@users.noreply.github.com> Date: Fri, 6 Sep 2024 01:06:38 +0900 Subject: [PATCH] =?UTF-8?q?Fix(frontend):=E7=BF=BB=E8=A8=B3=E3=81=8C?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E3=81=97=E3=81=A6=E3=82=82=E7=BF=BB=E8=A8=B3?= =?UTF-8?q?=E4=B8=AD=E3=81=AE=E3=81=BE=E3=81=BE=E3=81=AB=E3=81=AA=E3=82=8B?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(#415)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 2 +- packages/frontend/src/components/MkNote.vue | 1 + packages/frontend/src/components/MkNoteDetailed.vue | 1 + packages/frontend/src/components/MkSubNoteContent.vue | 1 + packages/frontend/src/pages/user/home.vue | 1 + packages/frontend/src/scripts/get-note-menu.ts | 8 ++++++++ 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index 5efa682e90..0f88e24a96 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 - Change: 溢れそうなチャートの型を大きいものに変更 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;