Skip to content

Commit

Permalink
fix search param detection
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbach committed Apr 15, 2024
1 parent 5f90d56 commit 40af4a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/renderer/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
createRootRoute,
createRoute,
createRouter,
defaultParseSearch,
} from "@tanstack/react-router";
import { MainScreen } from "../main/main-screen";
import { DetailsScreen } from "../details/details-screen";
Expand All @@ -23,12 +24,14 @@ const indexRoute = createRoute({
getParentRoute: () => rootRoute,
path: "/",
component: MainScreen,
validateSearch,
});

export const historyDetailsRoute = createRoute({
getParentRoute: () => rootRoute,
path: "/history/$id",
component: DetailsScreen,
validateSearch,
});

const settingsRoute = createRoute({
Expand All @@ -47,7 +50,11 @@ const routeTree = rootRoute.addChildren([
settingsRoute,
]);

export const router = createRouter({ routeTree, history: createHashHistory() });
export const router = createRouter({
routeTree,
history: createHashHistory(),
parseSearch: () => defaultParseSearch(window.location.search),
});

declare module "@tanstack/react-router" {
interface Register {
Expand Down

0 comments on commit 40af4a8

Please sign in to comment.