Merge pull request #1380 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2019-06-09 20:37:00 -06:00 committed by GitHub
commit e999d4be5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -48,12 +48,12 @@ class InboxValidator implements ShouldQueue
$profile = Profile::whereNull('domain')->whereUsername($username)->first(); $profile = Profile::whereNull('domain')->whereUsername($username)->first();
if(empty($profile)) { if(empty($profile) || empty($headers) || empty($payload)) {
return; return true;
} }
if($profile->status != null) { if($profile->status != null) {
return; return true;
} }
if($this->verifySignature($headers, $profile, $payload) == true) { if($this->verifySignature($headers, $profile, $payload) == true) {

View File

@ -10,13 +10,14 @@ class RelationshipTransformer extends Fractal\TransformerAbstract
{ {
public function transform(Profile $profile) public function transform(Profile $profile)
{ {
$user = Auth::user()->profile; $auth = Auth::check();
$user = $auth ? Auth::user()->profile : false;
return [ return [
'id' => (string) $profile->id, 'id' => (string) $profile->id,
'following' => $user->follows($profile), 'following' => $auth ? $user->follows($profile) : false,
'followed_by' => $user->followedBy($profile), 'followed_by' => $auth ? $user->followedBy($profile) : false,
'blocking' => $user->blockedIds()->contains($profile->id), 'blocking' => $auth ? $user->blockedIds()->contains($profile->id) : false,
'muting' => $user->mutedIds()->contains($profile->id), 'muting' => $auth ? $user->mutedIds()->contains($profile->id) : false,
'muting_notifications' => null, 'muting_notifications' => null,
'requested' => null, 'requested' => null,
'domain_blocking' => null, 'domain_blocking' => null,