Refactor to delete the properties for originalStatus in showStatusHistory in a better way
This commit is contained in:
parent
6f4b57e845
commit
29ff63d1b4
|
@ -88,16 +88,9 @@ const ExtraButtons = {
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
showStatusHistory () {
|
showStatusHistory () {
|
||||||
let originalStatus = { ...this.status }
|
const originalStatus = { ...this.status }
|
||||||
delete originalStatus.attachments
|
const stripFieldsList = ['attachments', 'created_at', 'emojis', 'text', 'raw_html', 'nsfw', 'poll', 'summary', 'summary_raw_html']
|
||||||
delete originalStatus.created_at
|
stripFieldsList.forEach(p => delete originalStatus[p])
|
||||||
delete originalStatus.emojis
|
|
||||||
delete originalStatus.text
|
|
||||||
delete originalStatus.raw_html
|
|
||||||
delete originalStatus.nsfw
|
|
||||||
delete originalStatus.poll
|
|
||||||
delete originalStatus.summary
|
|
||||||
delete originalStatus.summary_raw_html
|
|
||||||
this.$store.dispatch('openStatusHistoryModal', originalStatus)
|
this.$store.dispatch('openStatusHistoryModal', originalStatus)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue