diff --git a/src/routes/(_)tutorial/[[id]].tsx b/src/routes/(_)tutorial/[[id]].tsx index cbcce1c1a..b440a37ca 100644 --- a/src/routes/(_)tutorial/[[id]].tsx +++ b/src/routes/(_)tutorial/[[id]].tsx @@ -5,6 +5,7 @@ import { Errored, For, Loading, + onSettled, Show, untrack, } from "solid-js"; @@ -115,6 +116,12 @@ export default function Tutorial() { // Old solidjs.com lesson ids render their new lesson; the host redirects them. const id = () => canonicalTutorialId(params.id || firstTutorialId); const solved = () => new URLSearchParams(location.search).has("solved"); + // The page is prerendered without the query, so the button follows it only after hydration. + const [hydrated, setHydrated] = createSignal(false); + onSettled(() => { + setHydrated(true); + }); + const showSolved = () => hydrated() && solved(); const index = () => tutorialDirectory.findIndex((entry) => entry.internalName === id()); const entryAt = (i: number) => { @@ -186,9 +193,9 @@ export default function Tutorial() { > - {solved() ? "Reset" : "Solve"} + {showSolved() ? "Reset" : "Solve"}