Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(frontend):翻訳が成功しても翻訳中のままになる問題を修正 #415

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
-
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
Loading