Skip to content

Commit

Permalink
FIX BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenWizard2015 committed Jan 19, 2024
1 parent 936e9b3 commit a5b064d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/src/components/HoldToPour.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export function HoldToPourComponent({ startPump, stopPump, interval }) {
}
// tick every 100ms
const tid = setInterval(onTick, 100);
return () => { clearInterval(tid); }
return async () => {
clearInterval(tid);
if(isPouring) await stopPump();
};
}, [onTick, isPouring, stopPump, lastPouringTime]);

const handlePress = () => { setIsPouring(true); };
Expand Down

0 comments on commit a5b064d

Please sign in to comment.