merge: Cache note translations in Redis (!1027)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1027 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
commit
7b0ee41c77
6 changed files with 109 additions and 29 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
Add a link
Reference in a new issue