Skip to content

Commit fb94013

Browse files
committed
Improved partial rendering for threads
1 parent 3b56350 commit fb94013

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/views/stream_entries/_status.html.haml

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
- centered = include_threads && !is_predecessor && !is_successor
55

66
- if status.reply? && include_threads
7-
- @ancestors.each do |status|
8-
= render partial: 'status', locals: { status: status, is_predecessor: true }
7+
= render partial: 'status', collection: @ancestors, as: :status, locals: { is_predecessor: true }
98

109
.entry{ class: entry_classes(status, is_predecessor, is_successor, include_threads) }
1110
- if status.reblog?
@@ -43,5 +42,4 @@
4342
%li.transparent-background= link_to '', media.file.url, style: "background-image: url(#{media.file.url(:small)})", target: '_blank'
4443

4544
- if include_threads
46-
- @descendants.each do |status|
47-
= render partial: 'status', locals: { status: status, is_successor: true }
45+
= render partial: 'status', collection: @descendants, as: :status, locals: { is_successor: true }

0 commit comments

Comments
 (0)