logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 29ff63d1b420d0c36fb16c72389fdccd1294205a
parent 6f4b57e84559871f8c59f968d5cf17f2971e74c3
Author: Sean King <seanking2919@protonmail.com>
Date:   Sun, 26 Jun 2022 18:10:30 -0600

Refactor to delete the properties for originalStatus in showStatusHistory in a better way

Diffstat:

Msrc/components/extra_buttons/extra_buttons.js13+++----------
1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js @@ -88,16 +88,9 @@ const ExtraButtons = { })) }, showStatusHistory () { - let originalStatus = { ...this.status } - delete originalStatus.attachments - delete originalStatus.created_at - delete originalStatus.emojis - delete originalStatus.text - delete originalStatus.raw_html - delete originalStatus.nsfw - delete originalStatus.poll - delete originalStatus.summary - delete originalStatus.summary_raw_html + const originalStatus = { ...this.status } + const stripFieldsList = ['attachments', 'created_at', 'emojis', 'text', 'raw_html', 'nsfw', 'poll', 'summary', 'summary_raw_html'] + stripFieldsList.forEach(p => delete originalStatus[p]) this.$store.dispatch('openStatusHistoryModal', originalStatus) } },