feat(frontend): remove renote with by admin privilege (#11789)

This commit is contained in:
anatawa12 2023-09-05 19:29:52 +09:00 committed by GitHub
parent 2ccef59b63
commit b0eae49eaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 11 deletions

View file

@ -425,22 +425,26 @@ async function clip() {
}
function showRenoteMenu(viaKeyboard = false): void {
function getUnrenote(): MenuItem {
return {
text: i18n.ts.unrenote,
icon: 'ti ti-trash',
danger: true,
action: () => {
os.api('notes/delete', {
noteId: note.id,
});
isDeleted.value = true;
},
};
}
if (isMyRenote) {
pleaseLogin();
os.popupMenu([
getCopyNoteLinkMenu(note, i18n.ts.copyLinkRenote),
null,
{
text: i18n.ts.unrenote,
icon: 'ti ti-trash',
danger: true,
action: () => {
os.api('notes/delete', {
noteId: note.id,
});
isDeleted.value = true;
},
},
getUnrenote(),
], renoteTime.value, {
viaKeyboard: viaKeyboard,
});
@ -449,6 +453,7 @@ function showRenoteMenu(viaKeyboard = false): void {
getCopyNoteLinkMenu(note, i18n.ts.copyLinkRenote),
null,
getAbuseNoteMenu(note, i18n.ts.reportAbuseRenote),
$i.isModerator || $i.isAdmin ? getUnrenote() : undefined,
], renoteTime.value, {
viaKeyboard: viaKeyboard,
});