2016-12-08 07:50:46 +11:00
|
|
|
const DeleteButton = {
|
|
|
|
props: [ 'status' ],
|
|
|
|
methods: {
|
|
|
|
deleteStatus () {
|
|
|
|
const confirmed = 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 },
|
|
|
|
canDelete () { return this.currentUser.delete_others_notice || this.status.user.id == this.currentUser.id }
|
2016-12-08 07:50:46 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default DeleteButton
|