mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-26 22:40:45 +00:00
Update PublicApiController, fix edge case in timeline pagination
This commit is contained in:
parent
aa4b011e25
commit
9a7289198a
1 changed files with 3 additions and 3 deletions
|
@ -378,7 +378,7 @@ class PublicApiController extends Controller
|
||||||
return $status;
|
return $status;
|
||||||
})
|
})
|
||||||
->filter(function($s) use($filtered) {
|
->filter(function($s) use($filtered) {
|
||||||
return $s && in_array($s['account']['id'], $filtered) == false;
|
return $s && isset($s['account']) && in_array($s['account']['id'], $filtered) == false;
|
||||||
})
|
})
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ class PublicApiController extends Controller
|
||||||
$res = collect($feed)
|
$res = collect($feed)
|
||||||
->map(function($k) use($user) {
|
->map(function($k) use($user) {
|
||||||
$status = StatusService::get($k);
|
$status = StatusService::get($k);
|
||||||
if($user) {
|
if($status && isset($status['account']) && $user) {
|
||||||
$status['favourited'] = (bool) LikeService::liked($user->profile_id, $k);
|
$status['favourited'] = (bool) LikeService::liked($user->profile_id, $k);
|
||||||
$status['bookmarked'] = (bool) BookmarkService::get($user->profile_id, $k);
|
$status['bookmarked'] = (bool) BookmarkService::get($user->profile_id, $k);
|
||||||
$status['reblogged'] = (bool) ReblogService::get($user->profile_id, $k);
|
$status['reblogged'] = (bool) ReblogService::get($user->profile_id, $k);
|
||||||
|
@ -411,7 +411,7 @@ class PublicApiController extends Controller
|
||||||
return $status;
|
return $status;
|
||||||
})
|
})
|
||||||
->filter(function($s) use($filtered) {
|
->filter(function($s) use($filtered) {
|
||||||
return isset($s['account']) && in_array($s['account']['id'], $filtered) == false;
|
return $s && isset($s['account']) && in_array($s['account']['id'], $filtered) == false;
|
||||||
})
|
})
|
||||||
->values()
|
->values()
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
Loading…
Reference in a new issue