Skip to content

Commit 0485be4

Browse files
fix: prevent the tutorial erroring after navigating (#1352)
* Fix the tutorial erroring after navigating The `Workspace.reset` method was changed in a non-backward compatible way in commit eb1eb2b, which caused the call in the tutorial pages to not pass the proper value for the selected file. This was missed because the tutorial page didn't use `PageProps` for typing. * Remove unneeded type annotation The language server infers this automatically, turns out * Update +page.svelte --------- Co-authored-by: Tee Ming <chewteeming01@gmail.com>
1 parent c60f4c3 commit 0485be4

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

apps/svelte.dev/src/routes/tutorial/[...slug]/+page.svelte

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@
1515
import { page } from '$app/state';
1616
import Controls from './Controls.svelte';
1717
import Editor from '@sveltejs/repl/editor';
18-
import type { Snapshot } from './$types.js';
18+
import type { Snapshot, PageProps } from './$types.js';
1919
20-
interface Props {
21-
data: any;
22-
}
23-
24-
let { data }: Props = $props();
20+
let { data }: PageProps = $props();
2521
2622
let path = data.exercise.path;
2723
let show_editor = $state(false);
@@ -204,7 +200,7 @@
204200
sidebar.scrollTop = 0;
205201
}
206202
207-
workspace.reset(Object.values(a), data.exercise.focus);
203+
workspace.reset(Object.values(a), { tailwind: false }, data.exercise.focus);
208204
209205
const will_delete = previous_files.some((file) => !(file.name in a));
210206

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy