Skip to content

Commit a10e9c3

Browse files
committed
Use base path in redirect for conversation page
Updated the redirect in the conversation page loader to use the `base` path from `$app/paths` instead of a hardcoded root path. This ensures correct redirection when the app is deployed under a subpath.
1 parent 54bb628 commit a10e9c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes/conversation/[id]/+page.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useAPIClient, handleResponse } from "$lib/APIClient";
22
import { UrlDependency } from "$lib/types/UrlDependency";
33
import { redirect } from "@sveltejs/kit";
4+
import { base } from "$app/paths";
45

56
export const load = async ({ params, depends, fetch, url }) => {
67
depends(UrlDependency.Conversation);
@@ -13,6 +14,6 @@ export const load = async ({ params, depends, fetch, url }) => {
1314
.get({ query: { fromShare: url.searchParams.get("fromShare") ?? undefined } })
1415
.then(handleResponse);
1516
} catch {
16-
redirect(302, "/");
17+
redirect(302, `${base}/`);
1718
}
1819
};

0 commit comments

Comments
 (0)