Skip to content

Commit

Permalink
fix(app): fix router lookup on search params
Browse files Browse the repository at this point in the history
  • Loading branch information
matschik committed Mar 5, 2024
1 parent cfff6a7 commit e43f1aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build/template/footer.eta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer class="bg-gray-900 pb-20">
<h2 id="footer-heading" class="sr-only">Footer</h2>
<div class="mx-auto max-w-7xl px-6 pb-8 pt-16 sm:pt-24 lg:px-8 lg:pt-32">
<footer class="bg-gray-900">
<h2 class="sr-only">Footer</h2>
<div class="mx-auto max-w-7xl px-6 pb-20 pt-16 sm:pt-24 lg:px-8">
<div class="xl:grid xl:grid-cols-3 xl:gap-8">
<div class="space-y-8">
<a class="font-semibold text-xl flex items-center space-x-3" href="/">
Expand Down
8 changes: 4 additions & 4 deletions src/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@
}
if (frameworkIdsSelectedOnInit.length === 0) {
const frameworkIdsFromStorage = frameworkIdsStorage.getJSON();
const frameworkIdsFromStorage = frameworkIdsStorage
.getJSON()
?.filter(matchFrameworkId);
if (frameworkIdsFromStorage?.length > 0) {
frameworkIdsSelectedOnInit = frameworkIdsFromStorage.map((x) =>
x === "svelte" ? "svelte4" : x
);
frameworkIdsSelectedOnInit = frameworkIdsFromStorage;
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/Router.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
const currentRoute = writable({ component: null });
function navigate(path) {
const routePayload = router.lookup(path);
const urlParsed = new URL(path);
const routePayload = router.lookup(urlParsed.pathname);
if (routePayload) {
if (routePayload.component.toString().startsWith("class")) {
currentRoute.set(routePayload);
Expand All @@ -36,7 +37,7 @@
}
window.onpopstate = () => {
navigate(window.location.pathname);
navigate(window.location.href);
};
function handleClick(event) {
Expand All @@ -53,7 +54,7 @@
onMount(() => {
document.addEventListener("click", handleClick);
navigate(window.location.pathname);
navigate(window.location.href);
});
onDestroy(() => {
Expand Down

0 comments on commit e43f1aa

Please sign in to comment.