From ba19fb22a30c7220f91d9317df8902507d7fd803 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 10 Nov 2018 20:17:02 -0700 Subject: [PATCH] Update PostComponent.vue --- resources/assets/js/components/PostComponent.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 469c35014..5fff0dd66 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -299,6 +299,7 @@ export default { let el = $(v); el.val(token); }); + this.loadLikes(); this.fetchData(); }, methods: { @@ -363,7 +364,15 @@ export default { } $('.postPresenterLoader').addClass('d-none'); $('.postPresenterContainer').removeClass('d-none'); - } + }, + loadLikes() { + let likes = ls.get('likes'); + if(likes.length != 0) { + if(likes.indexOf(this.status.id) == 0) { + $('.far.fa-heart.text-dark').addClass('fas text-danger').removeClass('far text-dark'); + } + } + }, } } \ No newline at end of file