More fine-grained approach to listen for broadcasted refresh signals
Only listen for collections actually involved in the view
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
module CollectionsHelper
|
||||
def referenced_collections_from(records)
|
||||
Current.user.collections.where id: records.pluck(:collection_id).uniq
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
<% referenced_collections_from(records).each do |collection| %>
|
||||
<%= turbo_stream_from collection %>
|
||||
<% end %>
|
||||
@@ -1,7 +1,7 @@
|
||||
<% @page_title = @user_filtering.selected_collections_label %>
|
||||
<% turbo_exempts_page_from_cache %>
|
||||
|
||||
<%= render "filters/broadcasts", filter: @filter %>
|
||||
<%= render "cards/broadcasts", records: @page.records %>
|
||||
|
||||
<% content_for :head do %>
|
||||
<%= tag.meta property: "og:title", content: @page_title %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% @page_title = "Home" %>
|
||||
<% @header_class = "header--events" %>
|
||||
|
||||
<%= render "filters/broadcasts", filter: @filter %>
|
||||
<%= render "cards/broadcasts", records: @day_timeline.events %>
|
||||
|
||||
<% content_for :header do %>
|
||||
<%= render "filters/menu" %>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<% if filter.collections.any? %>
|
||||
<% filter.collections.each do |collection| %>
|
||||
<%= turbo_stream_from collection %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= turbo_stream_from :collections %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user