From eb0c7315bbfb7bfe647edcde3651f40df5c1e3c7 Mon Sep 17 00:00:00 2001 From: Brenley Dueck Date: Thu, 29 Oct 2026 23:05:21 -0500 Subject: [PATCH] fix(tutorial): show Reset after loading a solved lesson URL --- src/routes/(_)tutorial/[[id]].tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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"}