diff options
| author | Sean King <seanking2919@protonmail.com> | 2022-06-26 18:10:30 -0600 |
|---|---|---|
| committer | Sean King <seanking2919@protonmail.com> | 2022-06-26 18:10:30 -0600 |
| commit | 29ff63d1b420d0c36fb16c72389fdccd1294205a (patch) | |
| tree | 192f71634f2f7fcd8b4987b1135330c37406e6c1 /src/components/extra_buttons | |
| parent | 6f4b57e84559871f8c59f968d5cf17f2971e74c3 (diff) | |
Refactor to delete the properties for originalStatus in showStatusHistory in a better way
Diffstat (limited to 'src/components/extra_buttons')
| -rw-r--r-- | src/components/extra_buttons/extra_buttons.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 5ddb7f0f..ef040d26 100644 --- 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) } }, |
