mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
fix infinite spinner when translation request fails
This commit is contained in:
parent
871a4d3fb1
commit
7cf766d44c
1 changed files with 3 additions and 3 deletions
|
@ -293,12 +293,12 @@ export function getNoteMenu(props: {
|
|||
async function translate(): Promise<void> {
|
||||
if (props.translation.value != null) return;
|
||||
props.translating.value = true;
|
||||
const res = await misskeyApi('notes/translate', {
|
||||
props.translation.value = await misskeyApi('notes/translate', {
|
||||
noteId: appearNote.id,
|
||||
targetLang: miLocalStorage.getItem('lang') ?? navigator.language,
|
||||
}).finally(() => {
|
||||
props.translating.value = false;
|
||||
});
|
||||
props.translating.value = false;
|
||||
props.translation.value = res;
|
||||
}
|
||||
|
||||
const menuItems: MenuItem[] = [];
|
||||
|
|
Loading…
Add table
Reference in a new issue