Skip to content

Commit 1cb9a6b

Browse files
fix: Address bugs in SvelteKit “Preloading” tutorial example (#1334)
Fix the tutorial code: kit/preload Correctly capture the previous navigation state. Co-authored-by: Tee Ming <[email protected]>
1 parent fc8be25 commit 1cb9a6b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/svelte.dev/content/tutorial/04-advanced-sveltekit/03-link-options/01-preload/+assets/app-a/src/routes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if (navigating.to) {
1212
start = Date.now();
1313
end = null;
14-
previous = navigating;
14+
previous = { ...navigating };
1515
} else {
1616
end = Date.now();
1717
}

apps/svelte.dev/content/tutorial/04-advanced-sveltekit/03-link-options/01-preload/+assets/app-b/src/routes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if (navigating.to) {
1212
start = Date.now();
1313
end = null;
14-
previous = navigating;
14+
previous = { ...navigating };
1515
} else {
1616
end = Date.now();
1717
}

0 commit comments

Comments
 (0)