submitting form when loaded

calculates remaining time if there is a saved recorded time
This commit is contained in:
2025-02-09 21:06:39 +00:00
parent 36c4502595
commit d7aa4e3534

View File

@@ -67,6 +67,13 @@ export function App() {
return () => sub.unsubscribe(); return () => sub.unsubscribe();
}, [handleSubmit, watch]); }, [handleSubmit, watch]);
// submit form when loaded if we have a previously recorded time
useEffect(() => {
if (getStoredRecordedTime()) {
handleSubmit(onSubmit)(null);
}
}, [handleSubmit]);
return ( return (
<div class="window" style={{margin: "32px auto", width: "250px"}}> <div class="window" style={{margin: "32px auto", width: "250px"}}>
<div class="title-bar"> <div class="title-bar">