Skip to content

Commit 45ab34f

Browse files
committed
Redirect to / if no URI configured
1 parent 5a71d49 commit 45ab34f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/routes/_account.plan.index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Please see LICENSE in the repository root for full details.
55

66
import { queryOptions, useSuspenseQuery } from "@tanstack/react-query";
7-
import { createFileRoute } from "@tanstack/react-router";
7+
import { createFileRoute, redirect, useRouter } from "@tanstack/react-router";
88
import { useCallback, useEffect, useRef, useState } from "react";
99
import { graphql, useFragment } from "../gql";
1010
import { graphqlRequest } from "../graphql";
@@ -39,6 +39,8 @@ function Plan(): React.ReactElement {
3939
const { planManagementIframeUri } = useFragment(CONFIG_FRAGMENT, siteConfig);
4040

4141
if (!planManagementIframeUri) {
42+
const { navigate } = useRouter();
43+
navigate({ to: "/", replace: true }); // Redirect if no iframe URI is configured
4244
return <div />;
4345
}
4446

0 commit comments

Comments
 (0)