Skip to content

Commit b49a477

Browse files
hughnssandhose
andauthored
Update frontend/src/routes/_account.plan.index.tsx
Co-authored-by: Quentin Gliech <[email protected]>
1 parent 58aa499 commit b49a477

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ export const query = queryOptions({
2525

2626
export const Route = createFileRoute("/_account/plan/")({
2727
loader: async ({ context }) => {
28-
const { planManagementIframeUri } = (
29-
await context.queryClient.ensureQueryData(query)
30-
).siteConfig;
31-
if (planManagementIframeUri) {
32-
preload(planManagementIframeUri, { as: "document" });
33-
} else {
34-
throw redirect({ to: "/" });
35-
}
28+
const { siteConfig: { planManagementIframeUri } } =
29+
await context.queryClient.ensureQueryData(query);
30+
31+
if (!planManagementIframeUri)
32+
throw redirect({ to: "/", replace: true });
33+
34+
preload(planManagementIframeUri, { as: "document" });
3635
},
3736
component: Plan,
3837
});

0 commit comments

Comments
 (0)