pleroma-fe/src/components/delete_button/delete_button.js

18 lines
512 B
JavaScript
Raw Normal View History

const DeleteButton = {
props: [ 'status' ],
methods: {
deleteStatus () {
2017-02-23 08:43:40 +11:00
const confirmed = window.confirm('Do you really want to delete this status?')
if (confirmed) {
this.$store.dispatch('deleteStatus', { id: this.status.id })
}
}
},
computed: {
2016-12-09 06:26:05 +11:00
currentUser () { return this.$store.state.users.currentUser },
2017-02-23 08:43:40 +11:00
canDelete () { return this.currentUser.rights.delete_others_notice || this.status.user.id === this.currentUser.id }
}
}
export default DeleteButton