mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "Never show a negative number in the notifications badge"
This commit is contained in:
commit
ebe216e4c1
|
@ -787,6 +787,10 @@ class EchoHooks {
|
|||
$msgCount = $notifUser->getMessageCount() - $subtractMessages;
|
||||
$alertCount = $notifUser->getAlertCount() - $subtractAlerts;
|
||||
|
||||
// But make sure we never show a negative number (T130853)
|
||||
$msgCount = max( 0, $msgCount );
|
||||
$alertCount = max( 0, $alertCount );
|
||||
|
||||
$msgNotificationTimestamp = $notifUser->getLastUnreadMessageTime();
|
||||
$alertNotificationTimestamp = $notifUser->getLastUnreadAlertTime();
|
||||
|
||||
|
|
Loading…
Reference in a new issue