4 Commits

Author SHA1 Message Date
1fcb525211 Merge branch 'main' into deploy 2025-02-09 21:09:53 +00:00
d7aa4e3534 submitting form when loaded
calculates remaining time if there is a saved recorded time
2025-02-09 21:06:39 +00:00
e2b406946f Merge branch 'main' into deploy 2025-02-08 10:10:06 +00:00
74d95f08f5 added analytics 2025-02-08 09:24:03 +00:00
2 changed files with 8 additions and 0 deletions

View File

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

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">