submitting form when loaded
calculates remaining time if there is a saved recorded time
This commit is contained in:
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user