From 27b46f4306b66114a3bc40b8298f764419fb142d Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Wed, 31 Aug 2022 01:16:57 -0700 Subject: [PATCH] Fix order of comments in threads and under answers --- web/components/feed/contract-activity.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/components/feed/contract-activity.tsx b/web/components/feed/contract-activity.tsx index 744f06aa..0878e570 100644 --- a/web/components/feed/contract-activity.tsx +++ b/web/components/feed/contract-activity.tsx @@ -84,7 +84,10 @@ export function ContractCommentsActivity(props: { user={user} contract={contract} parentComment={parent} - threadComments={commentsByParentId[parent.id] ?? []} + threadComments={sortBy( + commentsByParentId[parent.id] ?? [], + (c) => c.createdTime + )} tips={tips} bets={bets} betsByUserId={betsByUserId} @@ -132,7 +135,10 @@ export function FreeResponseContractCommentsActivity(props: { contract={contract} user={user} answer={answer} - answerComments={commentsByOutcome[answer.number.toString()] ?? []} + answerComments={sortBy( + commentsByOutcome[answer.number.toString()] ?? [], + (c) => c.createdTime + )} tips={tips} betsByUserId={betsByUserId} commentsByUserId={commentsByUserId}