Skip to content

Commit e7a565d

Browse files
committed
Apply code review suggestions
1 parent 93258cc commit e7a565d

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

src/auth/views/Login.tsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { useQuery as useApolloQuery } from "@apollo/client";
2-
import { type AvailableExternalAuthenticationsQuery } from "@dashboard/graphql";
1+
import { useAvailableExternalAuthenticationsQuery } from "@dashboard/graphql";
2+
import { useAvailableExternalAuthenticationsStagingQuery } from "@dashboard/graphql/hooksStaging.generated";
33
import { isMainSchema, isStagingSchema } from "@dashboard/graphql/schemaVersion";
4-
import {
5-
type AvailableExternalAuthenticationsStagingQuery,
6-
PasswordLoginModeEnum,
7-
} from "@dashboard/graphql/staging";
4+
import { PasswordLoginModeEnum } from "@dashboard/graphql/staging";
85
import useNavigator from "@dashboard/hooks/useNavigator";
96
import { getAppMountUriForRedirect } from "@dashboard/utils/urls";
107
import { useEffect } from "react";
@@ -15,8 +12,6 @@ import LoginPage from "../components/LoginPage";
1512
import { type LoginFormData } from "../components/LoginPage/types";
1613
import { useAuthParameters } from "../hooks/useAuthParameters";
1714
import { useLastLoginMethod } from "../hooks/useLastLoginMethod";
18-
import { availableExternalAuthentications as availableExternalAuthenticationsQuery } from "../queries";
19-
import { availableExternalAuthenticationsStaging as availableExternalAuthenticationsStagingQuery } from "../queries.staging";
2015
import { loginCallbackPath, type LoginUrlQueryParams } from "../urls";
2116
import { useUser } from "../useUser";
2217

@@ -40,18 +35,15 @@ const LoginView = ({ params }: LoginViewProps) => {
4035
const isCallbackFlow = !!(params.code && params.state && isCallbackPath);
4136

4237
const { data: externalAuthenticationsMain, loading: externalAuthenticationsLoadingMain } =
43-
useApolloQuery<AvailableExternalAuthenticationsQuery>(availableExternalAuthenticationsQuery, {
38+
useAvailableExternalAuthenticationsQuery({
4439
skip: isCallbackFlow || isStagingSchema(),
4540
fetchPolicy: "network-only",
4641
});
4742
const { data: externalAuthenticationsStaging, loading: externalAuthenticationsLoadingStaging } =
48-
useApolloQuery<AvailableExternalAuthenticationsStagingQuery>(
49-
availableExternalAuthenticationsStagingQuery,
50-
{
51-
skip: isCallbackFlow || isMainSchema(),
52-
fetchPolicy: "network-only",
53-
},
54-
);
43+
useAvailableExternalAuthenticationsStagingQuery({
44+
skip: isCallbackFlow || isMainSchema(),
45+
fetchPolicy: "network-only",
46+
});
5547
const externalAuthentications = isStagingSchema()
5648
? externalAuthenticationsStaging
5749
: externalAuthenticationsMain;

0 commit comments

Comments
 (0)