From 84d83d908a84fd5e6d9d05c6a14035e345ceaa72 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Thu, 15 Dec 2022 17:52:19 +0100 Subject: [PATCH] client: add button to unrenote Changelog: Added --- locales/en-US.yml | 2 ++ packages/client/src/components/renote-button.vue | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/locales/en-US.yml b/locales/en-US.yml index bc6d47502..367964955 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -96,6 +96,8 @@ unfollow: "Unfollow" followRequestPending: "Follow request pending" renote: "Renote" unrenote: "Take back renote" +unrenoteAll: "Take back all renotes" +unrenoteAllConfirm: "Are you sure that you want to take back all renotes of this note?" quote: "Quote" pinnedNote: "Pinned note" you: "You" diff --git a/packages/client/src/components/renote-button.vue b/packages/client/src/components/renote-button.vue index d8248f20a..9e4dbb3e6 100644 --- a/packages/client/src/components/renote-button.vue +++ b/packages/client/src/components/renote-button.vue @@ -61,6 +61,22 @@ function renote(viaKeyboard = false): void { visibility: props.note.visibility, }); }, + }, { + text: i18n.ts.unrenoteAll, + icon: 'fas fa-trash-alt', + danger: true, + action: () => { + os.confirm({ + type: 'warning', + text: i18n.ts.unrenoteAllConfirm, + }).then(({ canceled }) => { + if (canceled) return; + + os.api('notes/unrenote', { + noteId: props.note.id, + }); + }); + }, }, { text: i18n.ts.quote, icon: 'fas fa-quote-right',