Filter out redemption bets from feed

This commit is contained in:
James Grugett 2022-03-10 16:12:07 -06:00
parent 48df0ac7ce
commit 7cc92b176f
2 changed files with 4 additions and 3 deletions

View File

@ -821,7 +821,7 @@ export function ContractFeed(props: {
let bets = useBets(contract.id) ?? props.bets
bets = isBinary
? bets.filter((bet) => !bet.isAnte)
? bets.filter((bet) => !bet.isAnte && !bet.isRedemption)
: bets.filter((bet) => !(bet.isAnte && (bet.outcome as string) === '0'))
if (feedType === 'multi') {
@ -885,7 +885,9 @@ export function ContractActivityFeed(props: {
const user = useUser()
let bets = props.bets.sort((b1, b2) => b1.createdTime - b2.createdTime)
let bets = props.bets
.filter((bet) => !bet.isAnte && !bet.isRedemption)
.sort((b1, b2) => b1.createdTime - b2.createdTime)
comments.sort((c1, c2) => c1.createdTime - c2.createdTime)
if (contract.outcomeType === 'FREE_RESPONSE') {

View File

@ -175,7 +175,6 @@ function BetsSection(props: {
bets: Bet[]
}) {
const { contract, user } = props
const isBinary = contract.outcomeType === 'BINARY'
const bets = useBets(contract.id) ?? props.bets
// Decending creation time.