From b9f64738b5540365082fc62fda4385f946a7f683 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Sun, 15 May 2022 00:03:02 -0700 Subject: [PATCH] Fix broken warmup function error handling --- web/components/bet-panel.tsx | 2 +- web/components/bets-list.tsx | 5 ++++- web/components/resolution-panel.tsx | 2 +- web/pages/create.tsx | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index 8fba3bf7..cdf45c81 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -215,7 +215,7 @@ function BuyPanel(props: { useEffect(() => { // warm up cloud function - placeBet({}).catch() + placeBet({}).catch(() => {}) }, []) useEffect(() => { diff --git a/web/components/bets-list.tsx b/web/components/bets-list.tsx index 403cb097..684b506a 100644 --- a/web/components/bets-list.tsx +++ b/web/components/bets-list.tsx @@ -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 }) { useEffect(() => { diff --git a/web/components/resolution-panel.tsx b/web/components/resolution-panel.tsx index 1aaabcfd..356587fa 100644 --- a/web/components/resolution-panel.tsx +++ b/web/components/resolution-panel.tsx @@ -20,7 +20,7 @@ export function ResolutionPanel(props: { }) { useEffect(() => { // warm up cloud function - resolveMarket({} as any).catch() + resolveMarket({} as any).catch(() => {}) }, []) const { contract, className } = props diff --git a/web/pages/create.tsx b/web/pages/create.tsx index 4edf1c46..13b6ea90 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -61,7 +61,7 @@ export function NewContract(props: { question: string; tag?: string }) { }, [creator]) useEffect(() => { - createContract({}).catch() // warm up function + createContract({}).catch(() => {}) // warm up function }, []) const [outcomeType, setOutcomeType] = useState('BINARY')