@@ -18,7 +18,6 @@ import { OAuthButton } from "@/components/ui/oauth-button";
1818import { SeperatorWithChildren } from "@/components/ui/separator" ;
1919import { useAppContext } from "@/context/app-context" ;
2020import { useUserContext } from "@/context/user-context" ;
21- import { useIsMounted } from "@/lib/hooks/use-is-mounted" ;
2221import { LoginSchema } from "@/schemas/login-schema" ;
2322import { useMutation } from "@tanstack/react-query" ;
2423import axios , { AxiosError } from "axios" ;
@@ -40,7 +39,6 @@ export const LoginPage = () => {
4039 const { providers, title, oauthAutoRedirect } = useAppContext ( ) ;
4140 const { search } = useLocation ( ) ;
4241 const { t } = useTranslation ( ) ;
43- const isMounted = useIsMounted ( ) ;
4442 const [ oauthAutoRedirectHandover , setOauthAutoRedirectHandover ] =
4543 useState ( false ) ;
4644 const [ showRedirectButton , setShowRedirectButton ] = useState ( false ) ;
@@ -112,31 +110,20 @@ export const LoginPage = () => {
112110 } ) ;
113111
114112 useEffect ( ( ) => {
115- if ( isMounted ( ) ) {
116- if (
117- oauthProviders . length !== 0 &&
118- providers . find ( ( provider ) => provider . id === oauthAutoRedirect ) &&
119- ! isLoggedIn &&
120- redirectUri
121- ) {
122- // Not sure of a better way to do this
123- // eslint-disable-next-line react-hooks/set-state-in-effect
124- setOauthAutoRedirectHandover ( true ) ;
125- oauthMutation . mutate ( oauthAutoRedirect ) ;
126- redirectButtonTimer . current = window . setTimeout ( ( ) => {
127- setShowRedirectButton ( true ) ;
128- } , 5000 ) ;
129- }
113+ if (
114+ providers . find ( ( provider ) => provider . id === oauthAutoRedirect ) &&
115+ ! isLoggedIn &&
116+ redirectUri
117+ ) {
118+ // Not sure of a better way to do this
119+ // eslint-disable-next-line react-hooks/set-state-in-effect
120+ setOauthAutoRedirectHandover ( true ) ;
121+ oauthMutation . mutate ( oauthAutoRedirect ) ;
122+ redirectButtonTimer . current = window . setTimeout ( ( ) => {
123+ setShowRedirectButton ( true ) ;
124+ } , 5000 ) ;
130125 }
131- } , [
132- isMounted ,
133- oauthProviders . length ,
134- providers ,
135- isLoggedIn ,
136- redirectUri ,
137- oauthAutoRedirect ,
138- oauthMutation ,
139- ] ) ;
126+ } , [ ] ) ;
140127
141128 useEffect (
142129 ( ) => ( ) => {
0 commit comments