Use sale amount for sold bets. Round one more item in the feed.

This commit is contained in:
jahooma 2022-01-10 11:38:44 -06:00
parent 188ab66029
commit dd6edc3b7a

View File

@ -47,7 +47,7 @@ function FeedComment(props: { activityItem: any }) {
<a href={person.href} className="font-medium text-gray-900"> <a href={person.href} className="font-medium text-gray-900">
{person.name} {person.name}
</a>{' '} </a>{' '}
placed M$ {amount} on <OutcomeLabel outcome={outcome} />{' '} placed {formatMoney(amount)} on <OutcomeLabel outcome={outcome} />{' '}
<Timestamp time={createdTime} /> <Timestamp time={createdTime} />
</p> </p>
</div> </div>
@ -286,7 +286,7 @@ function toFeedBet(bet: Bet) {
contractId: bet.contractId, contractId: bet.contractId,
userId: bet.userId, userId: bet.userId,
type: 'bet', type: 'bet',
amount: bet.amount, amount: bet.sale ? -bet.sale.amount : bet.amount,
outcome: bet.outcome, outcome: bet.outcome,
createdTime: bet.createdTime, createdTime: bet.createdTime,
date: dayjs(bet.createdTime).fromNow(), date: dayjs(bet.createdTime).fromNow(),
@ -299,7 +299,7 @@ function toFeedComment(bet: Bet, comment: Comment) {
contractId: bet.contractId, contractId: bet.contractId,
userId: bet.userId, userId: bet.userId,
type: 'comment', type: 'comment',
amount: bet.amount, amount: bet.sale ? -bet.sale.amount : bet.amount,
outcome: bet.outcome, outcome: bet.outcome,
createdTime: bet.createdTime, createdTime: bet.createdTime,
date: dayjs(bet.createdTime).fromNow(), date: dayjs(bet.createdTime).fromNow(),