summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2023-09-05 19:29:52 +0900
committerGitHub <noreply@github.com>2023-09-05 19:29:52 +0900
commitb0eae49eaa8eb24bc9a323eae904208fa063d551 (patch)
tree76245f75a2a7c9bb59d78fc2dfb27d53840cf86d /packages
parent2023.9.0-beta.3 (diff)
downloadsharkey-b0eae49eaa8eb24bc9a323eae904208fa063d551.tar.gz
sharkey-b0eae49eaa8eb24bc9a323eae904208fa063d551.tar.bz2
sharkey-b0eae49eaa8eb24bc9a323eae904208fa063d551.zip
feat(frontend): remove renote with by admin privilege (#11789)
Diffstat (limited to 'packages')
-rw-r--r--packages/frontend/src/components/MkNote.vue27
1 files changed, 16 insertions, 11 deletions
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue
index d98a6da0dc..85af667fbf 100644
--- a/packages/frontend/src/components/MkNote.vue
+++ b/packages/frontend/src/components/MkNote.vue
@@ -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,
});