Skip to content

Commit e22dc56

Browse files
committed
fix: address infinite redirect issue with latest tanstack start
See: TanStack/router#6089
1 parent 9a14766 commit e22dc56

3 files changed

Lines changed: 6 additions & 13 deletions

File tree

‎src/components/app/locale/locale-switcher-select.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ type Props = {
2121
const LocaleSwitcherSelect = ({ defaultValue, items, label }: Props) => {
2222
const [isPending, startTransition] = useTransition();
2323

24-
function onChange(value: Locale) {
24+
const onChange = (value: Locale) => {
2525
const locale = value;
2626
startTransition(() => {
2727
setLocale(locale);
2828
});
29-
}
29+
};
3030

3131
return (
3232
<DropdownMenu>
@@ -50,14 +50,14 @@ const LocaleSwitcherSelect = ({ defaultValue, items, label }: Props) => {
5050
{items.map((item) => (
5151
<DropdownMenuItem
5252
key={item.value}
53-
onSelect={() => onChange(item.value)}
53+
onClick={() => onChange(item.value)}
5454
>
5555
<div className="mr-2 w-4">
5656
{item.value === defaultValue && (
57-
<CheckIcon className="h-5 w-5 text-slate-600" />
57+
<CheckIcon className="h-5 w-5" />
5858
)}
5959
</div>
60-
<span className="text-slate-900">{item.label}</span>
60+
<span>{item.label}</span>
6161
</DropdownMenuItem>
6262
))}
6363
</DropdownMenuGroup>

‎src/server.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import { paraglideMiddleware } from "./paraglide/server.js";
55

66
export default {
77
fetch(req: Request): Promise<Response> {
8-
return paraglideMiddleware(req, ({ request }) => handler.fetch(request));
8+
return paraglideMiddleware(req, () => handler.fetch(req));
99
},
1010
};

‎vite.config.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ export default defineConfig({
3737
cookieName: "PARAGLIDE_LOCALE",
3838
strategy: ["url", "cookie", "preferredLanguage", "baseLocale"],
3939
urlPatterns: [
40-
{
41-
pattern: "/about",
42-
localized: [
43-
["en", "/en/about"],
44-
["de", "/de/ueber"],
45-
],
46-
},
4740
{
4841
pattern: "/:path(.*)?",
4942
localized: [

0 commit comments

Comments
 (0)