Update PostComponent.vue

This commit is contained in:
Daniel Supernault 2018-11-10 20:17:02 -07:00
parent 8a32194a0a
commit ba19fb22a3
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 10 additions and 1 deletions

View File

@ -299,6 +299,7 @@ export default {
let el = $(v); let el = $(v);
el.val(token); el.val(token);
}); });
this.loadLikes();
this.fetchData(); this.fetchData();
}, },
methods: { methods: {
@ -363,7 +364,15 @@ export default {
} }
$('.postPresenterLoader').addClass('d-none'); $('.postPresenterLoader').addClass('d-none');
$('.postPresenterContainer').removeClass('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');
}
}
},
} }
} }
</script> </script>