mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-02-24 07:00:46 +00:00
Merge pull request #5712 from intentionally-left-nil/fix-pulse-crash
Prevent pulse crash when it is not configured
This commit is contained in:
commit
2bbe7c9d04
1 changed files with 14 additions and 12 deletions
|
@ -74,19 +74,21 @@ class AppServiceProvider extends ServiceProvider
|
|||
return $user->is_admin === 1;
|
||||
});
|
||||
|
||||
Pulse::user(function ($user) {
|
||||
$acct = AccountService::get($user->profile_id, true);
|
||||
if (config('pulse.enabled', false)) {
|
||||
Pulse::user(function ($user) {
|
||||
$acct = AccountService::get($user->profile_id, true);
|
||||
|
||||
return $acct ? [
|
||||
'name' => $acct['username'],
|
||||
'extra' => $user->email,
|
||||
'avatar' => $acct['avatar'],
|
||||
] : [
|
||||
'name' => $user->username,
|
||||
'extra' => 'DELETED',
|
||||
'avatar' => '/storage/avatars/default.jpg',
|
||||
];
|
||||
});
|
||||
return $acct ? [
|
||||
'name' => $acct['username'],
|
||||
'extra' => $user->email,
|
||||
'avatar' => $acct['avatar'],
|
||||
] : [
|
||||
'name' => $user->username,
|
||||
'extra' => 'DELETED',
|
||||
'avatar' => '/storage/avatars/default.jpg',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
RateLimiter::for('app-signup', function (Request $request) {
|
||||
return Limit::perDay(10)->by($request->ip());
|
||||
|
|
Loading…
Reference in a new issue