From 54bc15332a1b744975f3f5da92a6164fd61b200a Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:54:03 -0500 Subject: [PATCH] fix: Ensure passed-in initial code overrides localStorage in REPL (#1167) --- src/components/controllers/repl/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/controllers/repl/index.jsx b/src/components/controllers/repl/index.jsx index bc561cf95..1a7f518af 100644 --- a/src/components/controllers/repl/index.jsx +++ b/src/components/controllers/repl/index.jsx @@ -18,7 +18,7 @@ import REPL_CSS from './examples/style.css?raw'; export function Repl({ code }) { const { route } = useLocation(); const { query } = useRoute(); - const [editorCode, setEditorCode] = useStoredValue('preact-www-repl-code', code); + const [editorCode, setEditorCode] = useStoredValue('preact-www-repl-code', code, true); const [runnerCode, setRunnerCode] = useState(editorCode); const [error, setError] = useState(null); const [copied, setCopied] = useState(false);