Skip to content

Commit

Permalink
Fix(frontend):翻訳が成功しても翻訳中のままになる問題を修正 (kokonect-link#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net authored Sep 5, 2024
1 parent f8c1f87 commit 7531403
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG_YOJO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-

### Client
-
- Fix: 翻訳が成功しても翻訳中のままになるのを修正 [#415](https://github.com/yojo-art/cherrypick/pull/415)

### Server
- Change: 溢れそうなチャートの型を大きいものに変更
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ async function translate(): Promise<void> {
text: err.id,
});
});
translating.value = false;
translation.value = res;

vibrate(defaultStore.state.vibrateSystem ? [5, 5, 10] : []);
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/components/MkNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ async function translate(): Promise<void> {
text: err.id,
});
});
translating.value = false;
translation.value = res;

vibrate(defaultStore.state.vibrateSystem ? [5, 5, 10] : []);
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/components/MkSubNoteContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ async function translate(): Promise<void> {
text: err.id,
});
});
translating.value = false;
translation.value = res;

vibrate(defaultStore.state.vibrateSystem ? [5, 5, 10] : []);
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/pages/user/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ async function translate(): Promise<void> {
text: err.id,
});
});
translating.value = false;
translation.value = res;

vibrate(defaultStore.state.vibrateSystem ? [5, 5, 10] : []);
Expand Down
8 changes: 8 additions & 0 deletions packages/frontend/src/scripts/get-note-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7531403

Please sign in to comment.