Update LikeService, show like count to status owner

pull/2757/head
Daniel Supernault 4 years ago
parent f47161fcd9
commit 4408e2ef8c
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -71,9 +71,16 @@ class LikeService {
$id = $like->profile_id;
return [
$res = [
'username' => ProfileService::get($id)['username'],
'others' => $status->likes_count >= 5,
];
if(request()->user()->profile_id == $status->profile_id) {
$res['total_count'] = $status->likes_count;
$res['total_count_pretty'] = number_format($res['total_count']);
}
return $res;
}
}

@ -228,7 +228,7 @@
<span class="like-count">Liked by
<a class="font-weight-bold text-dark" :href="'/'+status.liked_by.username">{{status.liked_by.username}}</a>
<span v-if="status.liked_by.others == true">
and <span class="font-weight-bold">others</span>
and <span class="font-weight-bold" v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> <span class="font-weight-bold">others</span>
</span>
</span>
</div>

Loading…
Cancel
Save