Kill counts of comments and trades on contract page (#900)

This commit is contained in:
Marshall Polaris 2022-09-20 15:53:35 -07:00 committed by GitHub
parent 589bf9651d
commit be4def49a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,9 +47,7 @@ export function ContractTabs(props: {
l.amount > 0
)
// Load comments here, so the badge count will be correct
const updatedComments = useComments(contract.id)
const comments = updatedComments ?? props.comments
const comments = useComments(contract.id) ?? props.comments
const betActivity = lps != null && (
<ContractBetsActivity
@ -107,18 +105,10 @@ export function ContractTabs(props: {
return (
<Tabs
currentPageForAnalytics="contract"
currentPageForAnalytics={'contract'}
tabs={[
{
title: 'Comments',
content: commentActivity,
badge: `${comments.length}`,
},
{
title: capitalize(PAST_BETS),
content: betActivity,
badge: `${visibleBets.length + visibleLps.length}`,
},
{ title: 'Comments', content: commentActivity },
{ title: capitalize(PAST_BETS), content: betActivity },
...(!user || !userBets?.length
? []
: [