From a5b064db1f105fc8c051ba55f8a0b56d73863233 Mon Sep 17 00:00:00 2001 From: GreenWizard2015 Date: Fri, 19 Jan 2024 07:56:54 +0000 Subject: [PATCH] FIX BUG --- ui/src/components/HoldToPour.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/components/HoldToPour.js b/ui/src/components/HoldToPour.js index 4266962..87a8914 100644 --- a/ui/src/components/HoldToPour.js +++ b/ui/src/components/HoldToPour.js @@ -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); };