From 23944bf47a1fdab9eb7f32a3a6077baa040efe57 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sat, 28 May 2022 15:57:12 -0500 Subject: [PATCH] Filter redemption bets out of market 'Bets' tab --- web/components/feed/activity-items.ts | 4 +--- web/components/feed/contract-activity.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web/components/feed/activity-items.ts b/web/components/feed/activity-items.ts index b8d99598..fce2cdc4 100644 --- a/web/components/feed/activity-items.ts +++ b/web/components/feed/activity-items.ts @@ -479,9 +479,7 @@ export function getRecentContractActivityItems( } ) { const { contractPath } = options - bets = bets - .filter((bet) => !bet.isRedemption) - .sort((b1, b2) => b1.createdTime - b2.createdTime) + bets = bets.sort((b1, b2) => b1.createdTime - b2.createdTime) comments = comments.sort((c1, c2) => c1.createdTime - c2.createdTime) const questionItem: QuestionItem = { diff --git a/web/components/feed/contract-activity.tsx b/web/components/feed/contract-activity.tsx index e061f475..a203bfa9 100644 --- a/web/components/feed/contract-activity.tsx +++ b/web/components/feed/contract-activity.tsx @@ -39,7 +39,7 @@ export function ContractActivity(props: { // eslint-disable-next-line react-hooks/rules-of-hooks const updatedBets = mode === 'only-recent' ? undefined : useBets(contract.id) - const bets = updatedBets ?? props.bets + const bets = (updatedBets ?? props.bets).filter((bet) => !bet.isRedemption) const items = mode === 'only-recent'