Skip to content

Commit 07a1b12

Browse files
committed
fix(site): reload page after setup is done
1 parent 41647ca commit 07a1b12

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

site/src/pages/SetupPage/SetupPage.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type FC } from "react";
22
import { Helmet } from "react-helmet-async";
33
import { useMutation } from "react-query";
4-
import { Navigate, useNavigate } from "react-router-dom";
4+
import { Navigate } from "react-router-dom";
55
import { pageTitle } from "utils/page";
66
import { createFirstUser } from "api/queries/users";
77
import { useAuth } from "contexts/auth/useAuth";
@@ -18,7 +18,6 @@ export const SetupPage: FC = () => {
1818
} = useAuth();
1919
const createFirstUserMutation = useMutation(createFirstUser());
2020
const setupIsComplete = !isConfiguringTheFirstUser;
21-
const navigate = useNavigate();
2221

2322
if (isLoading) {
2423
return <FullScreenLoader />;
@@ -45,7 +44,10 @@ export const SetupPage: FC = () => {
4544
onSubmit={async (firstUser) => {
4645
await createFirstUserMutation.mutateAsync(firstUser);
4746
await signIn(firstUser.email, firstUser.password);
48-
navigate("/templates");
47+
// The entitlements are fetched from the server and injected in the
48+
// page metadata. To ensure the data is up-to-date, a full page reload
49+
// is required.
50+
window.location.replace("/templates");
4951
}}
5052
/>
5153
</>

0 commit comments

Comments
 (0)