From 9528d97c0a930f1f7d3617ebec2f99896bd203ec Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 30 Sep 2019 22:38:52 -0600 Subject: [PATCH] Update StatusTransformers --- app/Transformer/Api/Mastodon/v1/StatusTransformer.php | 4 ++-- app/Transformer/Api/StatusTransformer.php | 4 ++-- resources/assets/js/components/Timeline.vue | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Transformer/Api/Mastodon/v1/StatusTransformer.php b/app/Transformer/Api/Mastodon/v1/StatusTransformer.php index 2cd6f123f..97f0cb4b8 100644 --- a/app/Transformer/Api/Mastodon/v1/StatusTransformer.php +++ b/app/Transformer/Api/Mastodon/v1/StatusTransformer.php @@ -28,8 +28,8 @@ class StatusTransformer extends Fractal\TransformerAbstract 'created_at' => $status->created_at->toJSON(), 'emojis' => [], 'replies_count' => 0, - 'reblogs_count' => $status->reblogs_count != 0 ? $status->reblogs_count: $status->shares()->count(), - 'favourites_count' => $status->likes_count != 0 ? $status->likes_count: $status->likes()->count(), + 'reblogs_count' => $status->reblogs_count, + 'favourites_count' => $status->likes_count, 'reblogged' => null, 'favourited' => null, 'muted' => null, diff --git a/app/Transformer/Api/StatusTransformer.php b/app/Transformer/Api/StatusTransformer.php index 5b251501e..c03a501f6 100644 --- a/app/Transformer/Api/StatusTransformer.php +++ b/app/Transformer/Api/StatusTransformer.php @@ -25,8 +25,8 @@ class StatusTransformer extends Fractal\TransformerAbstract 'content' => $status->rendered ?? $status->caption, 'created_at' => $status->created_at->format('c'), 'emojis' => [], - 'reblogs_count' => $status->reblogs_count != 0 ? $status->reblogs_count: $status->shares()->count(), - 'favourites_count' => $status->likes_count != 0 ? $status->likes_count: $status->likes()->count(), + 'reblogs_count' => $status->reblogs_count, + 'favourites_count' => $status->likes_count, 'reblogged' => $status->shared(), 'favourited' => $status->liked(), 'muted' => null, diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index a6904c652..fdf8c1233 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -304,7 +304,7 @@ -
+
@@ -606,9 +606,9 @@ this.max_id = Math.min(...ids); this.loading = false; $('.timeline .pagination').removeClass('d-none'); - if(this.feed.length == 4) { - this.fetchTimelineApi(); - } + // if(this.feed.length == 4) { + // this.fetchTimelineApi(); + // } if(this.hashtagPosts.length == 0) { this.fetchHashtagPosts(); }