diff --git a/web/components/contract-prob-graph.tsx b/web/components/contract-prob-graph.tsx
index 3be73c6b..94f9646a 100644
--- a/web/components/contract-prob-graph.tsx
+++ b/web/components/contract-prob-graph.tsx
@@ -47,7 +47,10 @@ export function ContractProbGraph(props: { contract: Contract }) {
const lessThanAWeek = dayjs(startDate).add(1, 'week').isAfter(latestTime)
return (
-
+
= 800 ? 400 : 250 }}
+ >
{
- const [size, setSize] = useState(
- typeof window === 'undefined'
- ? { width: undefined, height: undefined }
- : { width: window.innerWidth, height: window.innerHeight }
- )
+ const [size, setSize] = useState<{
+ width: number | undefined
+ height: number | undefined
+ }>({ width: undefined, height: undefined })
useEffect(() => {
const onResize = () => {
setSize({ width: window.innerWidth, height: window.innerHeight })
}
+ onResize()
window.addEventListener('resize', onResize)
return () => window.removeEventListener('resize', onResize)
}, [])