From ea2f8d8c22f8009dc7ffc063fcab8a323bc0de56 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:37:25 -0800 Subject: [PATCH] take back button after quote button if combined --- .../client/src/components/MkRenoteButton.vue | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 3b7cc7a02..ffba924f9 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -55,6 +55,15 @@ useTooltip(buttonRef, async (showing) => { const renote = async (viaKeyboard = false, ev?: MouseEvent) => { pleaseLogin(); + + const renotes = await os.api('notes/renotes', { + noteId: props.note.id, + limit: 11, + }); + + const users = renotes.map(x => x.user.id); + const hasRenotedBefore = users.includes($i.id); + let buttonActions = [{ text: i18n.ts.renote, icon: 'ph-repeat-bold ph-lg', @@ -73,26 +82,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { } }, }]; - const renotes = await os.api('notes/renotes', { - noteId: props.note.id, - limit: 11, - }); - const users = renotes.map(x => x.user.id); - const hasRenotedBefore = users.includes($i.id); - - if (hasRenotedBefore) { - buttonActions.push({ - text: i18n.ts.unrenote, - icon: 'ph-trash-bold ph-lg', - danger: true, - action: () => { - os.api('notes/unrenote', { - noteId: props.note.id, - }); - }, - }); - } if (!defaultStore.state.seperateRenoteQuote) { buttonActions.push({ text: i18n.ts.quote, @@ -105,6 +95,19 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { }, }); } + + if (hasRenotedBefore) { + buttonActions.push({ + text: i18n.ts.unrenote, + icon: 'ph-trash-bold ph-lg', + danger: true, + action: () => { + os.api('notes/unrenote', { + noteId: props.note.id, + }); + }, + }); + } os.popupMenu(buttonActions, buttonRef.value, { viaKeyboard }); };