fix: reply sort direction now follows the comment sort pill (descending param)
Replies within a comment thread were always sorted ascending regardless of the descending parameter. Now they respect it, matching root comment sort.
This commit is contained in:
@@ -200,7 +200,9 @@ final class IssueCommentThreads {
|
|||||||
ArrayList<Thread> threads = new ArrayList<>();
|
ArrayList<Thread> threads = new ArrayList<>();
|
||||||
for (Models.Comment root : roots) {
|
for (Models.Comment root : roots) {
|
||||||
ArrayList<Models.Comment> replies = repliesByRoot.getOrDefault(clean(root.id), new ArrayList<>());
|
ArrayList<Models.Comment> replies = repliesByRoot.getOrDefault(clean(root.id), new ArrayList<>());
|
||||||
replies.sort(IssueCommentThreads::compareCreatedAt);
|
replies.sort((left, right) -> descending
|
||||||
|
? compareCreatedAt(right, left)
|
||||||
|
: compareCreatedAt(left, right));
|
||||||
threads.add(new Thread(root, replies));
|
threads.add(new Thread(root, replies));
|
||||||
}
|
}
|
||||||
return threads;
|
return threads;
|
||||||
|
|||||||
Reference in New Issue
Block a user