diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 1c5a3ff29..18ce71e2d 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -42,7 +42,7 @@
@@ -108,7 +108,7 @@ {{ showComments ? 'Disable' : 'Enable'}} Comments - Edit + Edit Delete @@ -675,7 +675,8 @@ export default { ctxEmbedShowCaption: true, ctxEmbedShowLikes: false, ctxEmbedCompactMode: false, - layout: this.profileLayout + layout: this.profileLayout, + canEdit: false } }, watch: { @@ -773,6 +774,13 @@ export default { self.showComments = true; this.fetchComments(); } + if(this.ownerOrAdmin()) { + let od = new Date(this.status.created_at).getTime() + (1 * 24 * 60 * 60 * 1000); + let now = new Date().getTime(); + if(od > now) { + this.canEdit = true; + } + } this.loaded = true; }).catch(error => { swal('Oops!', 'An error occured, please try refreshing the page.', 'error');