mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-28 08:26:44 -06:00
fix translate button
This commit is contained in:
parent
e9e08b2ec2
commit
246a5c5d48
2 changed files with 10 additions and 6 deletions
|
@ -67,7 +67,7 @@
|
|||
"three": "0.169.0",
|
||||
"throttle-debounce": "5.0.2",
|
||||
"tinycolor2": "1.6.0",
|
||||
"tinyld/heavy": "^1.3.4",
|
||||
"tinyld": "^1.3.4",
|
||||
"tsc-alias": "1.8.10",
|
||||
"tsconfig-paths": "4.2.0",
|
||||
"typescript": "5.6.2",
|
||||
|
|
|
@ -585,14 +585,18 @@ const isForeignLanguage: boolean = appearNote.value.text != null && (() => {
|
|||
})();
|
||||
|
||||
async function translate(): Promise<void> {
|
||||
if (props.translation.value != null) return;
|
||||
props.translating.value = true;
|
||||
if (translation.value != null) return;
|
||||
collapsed.value = false;
|
||||
translating.value = true;
|
||||
if (props.mock) {
|
||||
return;
|
||||
}
|
||||
const res = await misskeyApi('notes/translate', {
|
||||
noteId: appearNote.id,
|
||||
noteId: appearNote.value.id,
|
||||
targetLang: miLocalStorage.getItem('lang') ?? navigator.language,
|
||||
});
|
||||
props.translating.value = false;
|
||||
props.translation.value = res;
|
||||
translating.value = false;
|
||||
translation.value = res;
|
||||
}
|
||||
|
||||
function showRenoteMenu(): void {
|
||||
|
|
Loading…
Reference in a new issue