Fall back to created_at if there are no events

This commit is contained in:
Jason Zimdars
2025-02-06 19:21:24 -06:00
parent 66d79e7836
commit 128b42be0d
+3 -5
View File
@@ -11,10 +11,8 @@
<%= image_tag "pop.svg", aria: { hidden: true }, size: 24, class: "colorize--white" %>
<span>Pop</span>
<% end %>
<% if event %>
<span class="bubble__pop-message">
(Pops automatically in <%= distance_of_time_in_words(Time.current, event.created_at + 30.days) %>.)
</span>
<% end %>
<span class="bubble__pop-message">
(Pops automatically in <%= distance_of_time_in_words(Time.current, (event&.created_at || bubble.created_at) + 30.days) %>.)
</span>
<% end %>
</div>