Skip to content

Commit

Permalink
fix(核心): 修复 TS+ 获取未读数据接口报错
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Nov 28, 2018
1 parent 5e55478 commit 4cba2b3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions app/Support/PinnedsNotificationEventer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,18 @@ public function dispatch()
{
$notifications = collect($this->events->dispatch($this->prefix));

$notifications = $notifications->reject(function ($notification) {
return (! isset($notification['namespace']) && $notification['namespace'] && class_exists($notification['namespace'])) || array_diff_key($this->fillable, $notification);
});
return $notification->reject(function ($notification): bool {
if (! is_array($notification)) {
return true;
} elseif (! isset($notification['namespace'])) {
return true;
} elseif (! class_exists($notification['namespace'])) {
return true;
} elseif (array_diff_key($this->fillable, $notification)) {
return true;
}

return $notifications;
return false;
});
}
}

0 comments on commit 4cba2b3

Please sign in to comment.