Allow navigation items to have their badge persist if they have a Stimulus controller

This fixes a bug which caused the PWA app badge to persist even though the user's inbox was empty.
This commit is contained in:
Karina Kwiatek 2023-05-30 21:58:02 +02:00
parent dce0c3a7cd
commit 1826da1e0a
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ module BootstrapHelper
"#{content_tag(:i, '', class: "fa fa-#{options[:icon]}")} #{body}"
end
end
unless options[:badge].nil?
if options.has_key?(:badge) || options.dig(:badge_attr, :data)&.has_key?(:controller)
badge_class = [
"badge",
("badge-#{options[:badge_color]}" unless options[:badge_color].nil?),