Fix issue sorting and timestamps

Issues should be sorted by creation time and we should show the creation
time as the issue timestamp. Otherwise edits will reorder the comment
thread.
This commit is contained in:
Rūdolfs Ošiņš
2024-10-28 14:11:48 +01:00
committed by Sebastian Martinez
parent 1f9f6505ab
commit 319b1502c6
2 changed files with 2 additions and 5 deletions
+1 -1
View File
@@ -115,7 +115,7 @@
author={reply.author}
caption="replied"
reactions={reply.reactions}
timestamp={reply.edits.slice(-1)[0].timestamp}
timestamp={reply.edits[0].timestamp}
body={reply.edits.slice(-1)[0].body}
editComment={editComment &&
canEditComment(reply.author.did) &&
+1 -4
View File
@@ -69,10 +69,7 @@
root: thread,
replies: issue.discussion
.filter(comment => comment.replyTo === thread.id)
.sort(
(a, b) =>
a.edits.slice(-1)[0].timestamp - b.edits.slice(-1)[0].timestamp,
),
.sort((a, b) => a.edits[0].timestamp - b.edits[0].timestamp),
};
}, []);