Skip to content

Commit d57dc38

Browse files
committed
"Clear" clicked cards when there is a new day
1 parent 81f765b commit d57dc38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ app.get("/", async (c: Context) => {
191191
const [bungus] = things.splice(Math.floor(rand() * things.length), 1);
192192
stuff.push(bungus);
193193
}
194+
const localStorageIdent = Math.floor(rand() * 10000);
194195

195196
return c.html(
196197
<Layout>
@@ -199,8 +200,8 @@ app.get("/", async (c: Context) => {
199200
{stuff.map((thing, i) => (
200201
<button
201202
_={`
202-
on click toggle .checked on me then set localStorage.clicked${i} to me matches .checked end
203-
on load if localStorage.clicked${i} == "true" then add .checked to me end
203+
on click toggle .checked on me then set localStorage.clicked${localStorageIdent}_${i} to me matches .checked end
204+
on load if localStorage.clicked${localStorageIdent}_${i} == "true" then add .checked to me end
204205
`}
205206
>
206207
{thing}

0 commit comments

Comments
 (0)