Add local only boost option

This commit is contained in:
naskya 2023-05-11 20:10:19 +09:00
parent 7985422c61
commit a719b386e7
No known key found for this signature in database
GPG key ID: 164DFF24E2D40139

View file

@ -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,