mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-26 03:47:40 -07:00
take back button after quote button if combined
This commit is contained in:
parent
a3ff46bb7f
commit
ea2f8d8c22
1 changed files with 22 additions and 19 deletions
|
@ -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 });
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue