Fall back to created_at if there are no events
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user