Skip to content

Commit b121eeb

Browse files
committed
do not cache pinned links sidebar view if some of them are timed
1 parent cd625b2 commit b121eeb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/views/layouts/_sidebar.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<% end %>
1313
<% end %>
1414

15-
1615
<% unless @community.is_fake %>
1716
<%# Featured widget %>
1817
<% if Rails.env.development? || @pinned_links.to_a.size > 0 %>
19-
<% cache @pinned_links do %>
18+
<% has_timed = @pinned_links.any?(&:timed?) %>
19+
<% cache_unless has_timed, @pinned_links do %>
2020
<div class="widget has-margin-4 is-teal">
2121
<% if Rails.env.development? || @pinned_links.to_a.size > 0 %>
2222
<div class="widget--header">Featured</div>
@@ -122,8 +122,8 @@
122122
<% if can_see_deleted_posts? && !at_least_moderator? %>
123123
<li><a href="/mod/deleted">Recent Deletions</a></li>
124124
<% end %>
125-
<%# this calls into application_helper, not the user model! %>
126-
<% if at_least_moderator? %>
125+
<%# this calls into application_helper, not the user model! %>
126+
<% if at_least_moderator? %>
127127
<li><%= link_to 'Moderator Tools', moderator_path %></li>
128128
<% end %>
129129
<% if admin? %>

0 commit comments

Comments
 (0)