Skip to content

Commit

Permalink
Hide the link if the url is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Gailbear committed Dec 1, 2023
1 parent 2f4ef7d commit 574ef45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/serializers/conclar/session_serializer_with_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Conclar::SessionSerializerWithLinks < ActiveModel::Serializer
end

attribute :desc do
if object.integrations
if object.integrations && object.integrations.dig('smofcon', 'link') != ''
"#{object.description}<p><a href=\"#{object.integrations.dig('smofcon', 'link')}\" target=\"_blank\">#{object.integrations.dig('smofcon', 'text') || 'Click here to view'}</a></p>"
else
object.description
Expand Down

0 comments on commit 574ef45

Please sign in to comment.