From 75fdc72e222dee612137e4521dab1e44191948bb Mon Sep 17 00:00:00 2001 From: Jiayi Zheng Date: Sun, 4 Dec 2016 18:30:00 +0100 Subject: Implements feature status delete Fixes issue #4 --- src/components/status/status.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/components/status/status.js') diff --git a/src/components/status/status.js b/src/components/status/status.js index 0bf2ecde..8b2561cf 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -20,7 +20,9 @@ const Status = { }, loggedIn () { return !!this.$store.state.users.currentUser - } + }, + deleted () { return this.statusoid.deleted }, + canDelete () { return this.statusoid.user.rights.delete_others_notice || this.statusoid.user.id == this.$store.state.users.currentUser.id } }, components: { Attachment, @@ -31,6 +33,12 @@ const Status = { methods: { toggleReplying () { this.replying = !this.replying + }, + deleteStatus () { + const confirmed = confirm('Do you really want to delete this status?') + if (confirmed) { + this.$store.dispatch('deleteStatus', { id: this.status.id }) + } } } } -- cgit v1.2.3-70-g09d2