Preserve feed ordering based on initial fetch of bets

This commit is contained in:
James Grugett 2022-03-04 10:27:54 -08:00
parent 04de95337a
commit 4169b335d8

View File

@ -22,7 +22,7 @@ import {
useFilterYourContracts,
useFindActiveContracts,
} from '../hooks/use-find-active-contracts'
import { useRecentBets } from '../hooks/use-bets'
import { useGetRecentBets, useRecentBets } from '../hooks/use-bets'
import { useActiveContracts } from '../hooks/use-contracts'
import { useRecentComments } from '../hooks/use-comments'
@ -50,12 +50,13 @@ const Home = (props: {
contracts
)
const recentBets = useRecentBets()
const initialRecentBets = useGetRecentBets()
const recentBets = useRecentBets() ?? initialRecentBets
const recentComments = useRecentComments() ?? props.recentComments
const { activeContracts } = useFindActiveContracts({
contracts: yourContracts,
recentBets: recentBets ?? [],
recentBets: initialRecentBets ?? [],
recentComments,
})