diff --git a/src/Pages/FilaChat.php b/src/Pages/FilaChat.php index 2b7b4ac..9089eea 100644 --- a/src/Pages/FilaChat.php +++ b/src/Pages/FilaChat.php @@ -25,9 +25,10 @@ public static function getNavigationLabel(): string return __(config('filachat.navigation_label')); } - public static function getNavigationBadgeColor(): string|array|null + public static function getNavigationBadgeColor(): string | array | null { $count = intval(self::getNavigationBadge()); + return $count > 0 ? 'danger' : parent::getNavigationBadgeColor(); } @@ -38,10 +39,11 @@ public static function getNavigationBadge(): ?string ->where('last_read_at', null) ->where('receiverable_id', auth()->id())->count(); } + return parent::getNavigationBadge(); } - public static function getNavigationIcon(): string|Htmlable|null + public static function getNavigationIcon(): string | Htmlable | null { return config('filachat.navigation_icon'); } @@ -70,12 +72,12 @@ public function getTitle(): string return __(config('filachat.navigation_label')); } - public function getMaxContentWidth(): MaxWidth|string|null + public function getMaxContentWidth(): MaxWidth | string | null { return config('filachat.max_content_width'); } - public function getHeading(): string|Htmlable + public function getHeading(): string | Htmlable { return ''; // should be empty by default }