Fix reply ordering bug

This commit is contained in:
Eric B. Budd 2021-09-21 23:58:43 -05:00
parent 08694c1403
commit 06850ff6fb
1 changed files with 3 additions and 1 deletions

View File

@ -550,7 +550,9 @@ class Message
# Find all messages replying to the current topic, including replies to topics
# which have been edited.
def replies
(Corpus.find_all_by_parent_hash(hash) + ((edit_predecessor && edit_predecessor.replies) || [])).compact
all_replies = Corpus.find_all_by_parent_hash(hash)
all_replies += ((edit_predecessor && edit_predecessor.replies) || [])
all_replies.compact.sort_by{ |reply| Corpus.index_of(reply) }
end
def id