From 128b42be0dcf7bf4e5b069e55d3cdd50478111b4 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 6 Feb 2025 19:21:24 -0600 Subject: [PATCH] Fall back to `created_at` if there are no events --- app/views/bubbles/_pop_toggle.html.erb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/bubbles/_pop_toggle.html.erb b/app/views/bubbles/_pop_toggle.html.erb index 420aa1367..07ab43db8 100644 --- a/app/views/bubbles/_pop_toggle.html.erb +++ b/app/views/bubbles/_pop_toggle.html.erb @@ -11,10 +11,8 @@ <%= image_tag "pop.svg", aria: { hidden: true }, size: 24, class: "colorize--white" %> Pop <% end %> - <% if event %> - - (Pops automatically in <%= distance_of_time_in_words(Time.current, event.created_at + 30.days) %>.) - - <% end %> + + (Pops automatically in <%= distance_of_time_in_words(Time.current, (event&.created_at || bubble.created_at) + 30.days) %>.) + <% end %>