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

This commit is contained in:
Sean King 2022-06-26 18:10:30 -06:00
parent 6f4b57e845
commit 29ff63d1b4
No known key found for this signature in database
GPG Key ID: 510C52BACD6E7257
1 changed files with 3 additions and 10 deletions

View File

@ -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)
}
},