Forráskód Böngészése

Merge pull request #2757 from pixelfed/staging

Staging
daniel 4 éve
szülő
commit
f960f63b6f

+ 1 - 0
CHANGELOG.md

@@ -86,6 +86,7 @@
 - Updated Timeline component, change like logic. ([7bcbf96b](https://github.com/pixelfed/pixelfed/commit/7bcbf96b))
 - Updated LikeService, fix likedBy method. ([a5e64da6](https://github.com/pixelfed/pixelfed/commit/a5e64da6))
 - Updated PublicApiController, increase public timeline to 6 months from 3. ([8a736432](https://github.com/pixelfed/pixelfed/commit/8a736432))
+- Updated LikeService, show like count to status owner. ([4408e2ef](https://github.com/pixelfed/pixelfed/commit/4408e2ef))
 -  ([](https://github.com/pixelfed/pixelfed/commit/))
 
 ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10)

+ 0 - 2
app/Jobs/StatusPipeline/StatusDelete.php

@@ -11,7 +11,6 @@ use App\{
 	Status,
 	StatusHashtag,
 };
-use App\Models\StatusVideo;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
 use Illuminate\Foundation\Bus\Dispatchable;
@@ -119,7 +118,6 @@ class StatusDelete implements ShouldQueue
 						->forceDelete();
 					$tag->delete();
 			});
-			StatusVideo::whereStatusId($status->id)->delete();
 			AccountInterstitial::where('item_type', 'App\Status')
 				->where('item_id', $status->id)
 				->delete();

+ 8 - 1
app/Services/LikeService.php

@@ -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;
 	}
 }

BIN
public/js/status.js


BIN
public/js/timeline.js


BIN
public/mix-manifest.json


+ 1 - 1
resources/assets/js/components/PostComponent.vue

@@ -225,7 +225,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 text-dark cursor-pointer" @click="likesModal">others</span>
+								and <span class="font-weight-bold text-dark cursor-pointer" @click="likesModal"><span v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> others</span>
 							</span>
 						</span>
 					</div>

+ 1 - 1
resources/assets/js/components/Timeline.vue

@@ -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>