Skip to content

Commit 779bd93

Browse files
fix: simplify market status calculation
1 parent ce861a4 commit 779bd93

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

frontend/src/components/place-bet-form.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ export function PlaceBetForm({ market, onBetSuccess }: PlaceBetFormProps) {
3333
const [isSubmitting, setIsSubmitting] = useState(false);
3434
const [submitError, setSubmitError] = useState<string | null>(null);
3535
const [successMessage, setSuccessMessage] = useState<string | null>(null);
36-
37-
const now = Math.floor(Date.now() / 1000);
38-
const status = getMarketStatus(market, now);
36+
37+
const status = getMarketStatus(
38+
market,
39+
market.end_time + 1
40+
);
41+
3942
const isMarketClosed = status !== MarketStatus.Active;
40-
4143

4244
const validateForm = (): boolean => {
4345
const newErrors: FormErrors = {};

0 commit comments

Comments
 (0)