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:
parent
dce0c3a7cd
commit
1826da1e0a
|
@ -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?),
|
||||
|
|
Loading…
Reference in New Issue