From 89ac6f1b5a0ee6d8dbaaeffea573081041089e85 Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Thu, 11 Nov 2021 14:53:32 -0600 Subject: [PATCH] Check for presence rather than falsey when detecting tag color (#15356) Fallback on empty string as well as nil to the site default tag color --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 983874e53..3bcc3ea75 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -298,7 +298,7 @@ module ApplicationHelper end def render_tag_link(tag, filled: false, monochrome: false, classes: "") - color = tag_colors(tag)[:background] || Settings::UserExperience.primary_brand_color_hex + color = tag_colors(tag)[:background].presence || Settings::UserExperience.primary_brand_color_hex color_faded = Color::CompareHex.new([color]).opacity(0.1) label = safe_join([content_tag(:span, "#", class: "crayons-tag__prefix"), tag])