diff --git a/public/js/app.js b/public/js/app.js index 0943d1b7b..6b5aee0fd 100644 Binary files a/public/js/app.js and b/public/js/app.js differ diff --git a/public/js/components.js b/public/js/components.js index fc2c3c50b..770e1ecaa 100644 Binary files a/public/js/components.js and b/public/js/components.js differ diff --git a/public/js/discover.js b/public/js/discover.js index 294f45bc1..f2104ca4d 100644 Binary files a/public/js/discover.js and b/public/js/discover.js differ diff --git a/public/js/micro.js b/public/js/micro.js index 665013504..fe10627c6 100644 Binary files a/public/js/micro.js and b/public/js/micro.js differ diff --git a/public/js/profile.js b/public/js/profile.js index 0cebed1f8..1bdcab3e2 100644 Binary files a/public/js/profile.js and b/public/js/profile.js differ diff --git a/public/js/status.js b/public/js/status.js index 7a8de2437..d9d233472 100644 Binary files a/public/js/status.js and b/public/js/status.js differ diff --git a/public/js/timeline.js b/public/js/timeline.js index ba1d0a160..6437bb35c 100644 Binary files a/public/js/timeline.js and b/public/js/timeline.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 78fb96e27..9d3ea957a 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components/Micro.vue b/resources/assets/js/components/Micro.vue index e3f7b685e..b2b66bc20 100644 --- a/resources/assets/js/components/Micro.vue +++ b/resources/assets/js/components/Micro.vue @@ -3,7 +3,6 @@ \ No newline at end of file diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index fff135157..334cfcc80 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -27,23 +27,23 @@ {{ statusUsername }} -
+
@@ -238,9 +238,9 @@ export default { props: ['status-id', 'status-username', 'status-template', 'status-url', 'status-profile-url', 'status-avatar'], data() { return { - status: {}, + status: false, media: {}, - user: {}, + user: false, reactions: { liked: false, shared: false @@ -517,14 +517,28 @@ export default { } axios.post('/i/delete', { type: 'status', - item: status.id + item: this.status.id }).then(res => { swal('Success', 'You have successfully deleted this post', 'success'); + window.location.href = '/'; }).catch(err => { swal('Error', 'Something went wrong. Please try again later.', 'error'); }); } + }, + + owner() { + return this.user.id === this.status.account.id; + }, + + admin() { + return this.user.is_admin == true; + }, + + ownerOrAdmin() { + return this.owner() || this.admin(); } - } + + }, }