Skip to content

Commit

Permalink
Make contract tabs listen to bets
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Feb 11, 2025
1 parent 0dcac21 commit 8734841
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions web/components/contract/contract-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ import generateFilterDropdownItems from '../search/search-dropdown-helpers'
import { useAPIGetter } from 'web/hooks/use-api-getter'
import { api } from 'web/lib/api/api'
import { TRADE_TERM } from 'common/envs/constants'
import { listenToOrderUpdates } from 'client-common/hooks/use-bets'
import {
listenToOrderUpdates,
useContractBets,
} from 'client-common/hooks/use-bets'
import { useIsPageVisible } from 'web/hooks/use-page-visible'

export function ContractTabs(props: {
Expand Down Expand Up @@ -196,10 +199,15 @@ export const CommentsTabContent = memo(function CommentsTabContent(props: {
undefined,
'comments-' + staticContract.id
)
const { data: bets } = useAPIGetter('bets', {
contractId: staticContract.id,
commentRepliesOnly: true,
})

const bets = useContractBets(
staticContract.id,
{
commentRepliesOnly: true,
},
useIsPageVisible,
() => api('bets')
)

const isPageVisible = useIsPageVisible()
const { data: newFetchedComments } = useAPIGetter(
Expand Down

0 comments on commit 8734841

Please sign in to comment.