79519163

Date: 2025-03-19 05:11:20
Score: 0.5
Natty:
Report link

Simply call cancelOrder() at the same moment you're verifying that time <= 0:

useEffect(() => {
  if (time > 0) {
    const timer = setTimeout(() => setTime(time - 0.1), 100);

    return () => {
      clearTimeout(timer);
    };
  } else {
    cancelOrder();
    setHidden(true);
  }
}, [time]);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Kishan Dobariya