Skip to content

Commit

Permalink
fix: update disable bid (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
quangdz1704 authored Jan 18, 2024
1 parent c9d15cb commit d8a1b41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/CoHarvest/hooks/useCountdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ export const useCountdown = ({ bidInfo, onStart, onEnd }: CountDownType) => {
const [start, setStart] = useState(bidInfo?.start_time);
const [end, setEnd] = useState(bidInfo?.end_time);
const [timeRemaining, setTimeRemaining] = useState(() => calcDiffTime(getTimeDateNow, end));
const [isStarted, setIsStarted] = useState(() => getTimeDateNow >= start);
const [isStarted, setIsStarted] = useState(() => {
const isStart = getTimeDateNow >= start;

if (isStart) {
onStart();
}
return isStart;
});

useEffect(() => {
if (!bidInfo.round) return;
Expand Down

0 comments on commit d8a1b41

Please sign in to comment.