Skip to content

Commit

Permalink
fix: setting active route
Browse files Browse the repository at this point in the history
  • Loading branch information
motzel committed Oct 31, 2023
1 parent e2e887a commit d77db9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Router.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
// pick an active Route after all Routes have been registered.
$: {
const bestMatch = pick($routes, $location.pathname);
activeRoute.set({ ...bestMatch, preserveScroll });
activeRoute.set(bestMatch ? {...bestMatch, preserveScroll} : bestMatch);
}

if (!locationContext) {
Expand Down

0 comments on commit d77db9c

Please sign in to comment.