Fix broken warmup function error handling

This commit is contained in:
Marshall Polaris 2022-05-15 00:03:02 -07:00
parent 61da821b59
commit b9f64738b5
4 changed files with 7 additions and 4 deletions

View File

@ -215,7 +215,7 @@ function BuyPanel(props: {
useEffect(() => { useEffect(() => {
// warm up cloud function // warm up cloud function
placeBet({}).catch() placeBet({}).catch(() => {})
}, []) }, [])
useEffect(() => { useEffect(() => {

View File

@ -553,7 +553,10 @@ function BetRow(props: { bet: Bet; contract: Contract; saleBet?: Bet }) {
) )
} }
const warmUpSellBet = _.throttle(() => sellBet({}).catch(), 5000 /* ms */) const warmUpSellBet = _.throttle(
() => sellBet({}).catch(() => {}),
5000 /* ms */
)
function SellButton(props: { contract: Contract; bet: Bet }) { function SellButton(props: { contract: Contract; bet: Bet }) {
useEffect(() => { useEffect(() => {

View File

@ -20,7 +20,7 @@ export function ResolutionPanel(props: {
}) { }) {
useEffect(() => { useEffect(() => {
// warm up cloud function // warm up cloud function
resolveMarket({} as any).catch() resolveMarket({} as any).catch(() => {})
}, []) }, [])
const { contract, className } = props const { contract, className } = props

View File

@ -61,7 +61,7 @@ export function NewContract(props: { question: string; tag?: string }) {
}, [creator]) }, [creator])
useEffect(() => { useEffect(() => {
createContract({}).catch() // warm up function createContract({}).catch(() => {}) // warm up function
}, []) }, [])
const [outcomeType, setOutcomeType] = useState<outcomeType>('BINARY') const [outcomeType, setOutcomeType] = useState<outcomeType>('BINARY')