1 Commits

Author SHA1 Message Date
d7aa4e3534 submitting form when loaded
calculates remaining time if there is a saved recorded time
2025-02-09 21:06:39 +00:00
2 changed files with 7 additions and 1 deletions

View File

@@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light" />
<title>Daily Time Tracking</title>
<script defer src="https://umami.knier.uk/script.js" data-website-id="8776a11a-9f28-49f4-9b95-87cf1317a9a1"></script>
</head>
<body>
<div id="app"></div>

View File

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