From 6ac20d553cc796df542a314ec11add486ccd14eb Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 11 May 2023 20:10:19 +0900 Subject: [PATCH 1/2] Add local only boost option --- .../client/src/components/MkRenoteButton.vue | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 090321003..18da67ea2 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -179,6 +179,42 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { }); } + if (canRenote) { + buttonActions.push({ + text: `${i18n.ts.renote} (${i18n.ts.local})`, + icon: "ph-hand-first ph-bold ph-lg", + danger: false, + action: () => { + os.api("notes/create", + props.note.visibility === "specified" + ? { + renoteId: props.note.id, + visibility: props.note.visibility, + visibleUserIds: props.note.visibleUserIds, + localOnly: true, + } + : { + renoteId: props.note.id, + visibility: props.note.visibility, + localOnly: true, + } + }); + const el = + ev && + ((ev.currentTarget ?? ev.target) as + | HTMLElement + | null + | undefined); + if (el) { + const rect = el.getBoundingClientRect(); + const x = rect.left + el.offsetWidth / 2; + const y = rect.top + el.offsetHeight / 2; + os.popup(Ripple, { x, y }, {}, "end"); + } + }, + }); + } + if (!defaultStore.state.seperateRenoteQuote) { buttonActions.push({ text: i18n.ts.quote, From 6024d55d45ec22d6936b51cb1f1a7572ee8b845b Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 11 May 2023 20:28:32 +0900 Subject: [PATCH 2/2] Fix silly typo, format --- .../client/src/components/MkRenoteButton.vue | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 18da67ea2..b86ca535b 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -182,23 +182,24 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { if (canRenote) { buttonActions.push({ text: `${i18n.ts.renote} (${i18n.ts.local})`, - icon: "ph-hand-first ph-bold ph-lg", + icon: "ph-hand-fist ph-bold ph-lg", danger: false, action: () => { - os.api("notes/create", + os.api( + "notes/create", props.note.visibility === "specified" - ? { - renoteId: props.note.id, - visibility: props.note.visibility, - visibleUserIds: props.note.visibleUserIds, - localOnly: true, - } - : { - renoteId: props.note.id, - visibility: props.note.visibility, - localOnly: true, - } - }); + ? { + renoteId: props.note.id, + visibility: props.note.visibility, + visibleUserIds: props.note.visibleUserIds, + localOnly: true, + } + : { + renoteId: props.note.id, + visibility: props.note.visibility, + localOnly: true, + } + ); const el = ev && ((ev.currentTarget ?? ev.target) as