Merge pull request #11197 from annando/issue-11156

Issue 11156: Display "49+" notifications if there are 50 or more
This commit is contained in:
Tobias Diekershoff 2022-02-01 07:15:12 +01:00 committed by GitHub
commit 52f5e94bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -350,9 +350,11 @@ function ping_init(App $a)
} }
if ($format == 'json') { if ($format == 'json') {
$notification_count = $sysnotify_count + $intro_count + $register_count;
$data['groups'] = $groups_unseen; $data['groups'] = $groups_unseen;
$data['forums'] = $forums_unseen; $data['forums'] = $forums_unseen;
$data['notification'] = $sysnotify_count + $intro_count + $register_count; $data['notification'] = ($notification_count < 50) ? $notification_count : '49+';
$data['notifications'] = $notifications; $data['notifications'] = $notifications;
$data['sysmsgs'] = [ $data['sysmsgs'] = [
'notice' => $sysmsgs, 'notice' => $sysmsgs,