From 975af0db61698932c76dbce07b326d1aa0a9d85c Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 12 Apr 2024 09:02:42 -0400 Subject: [PATCH 1/2] readd completeOnboarding call --- frontend/pages/Login.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/pages/Login.tsx b/frontend/pages/Login.tsx index 9b96105b..8160377d 100644 --- a/frontend/pages/Login.tsx +++ b/frontend/pages/Login.tsx @@ -5,12 +5,15 @@ import { useSignIn } from '@clerk/clerk-expo'; import { useNavigation } from '@react-navigation/native'; import { AuthNavigationProp } from '../types/navigationTypes'; import { ClerkErrorResponse } from '../types/types'; +import { useDispatch } from 'react-redux'; +import { completeOnboarding } from '../reducers/onboarding/onboardingReducer'; const Login: React.FC = () => { const navigation = useNavigation(); const { signIn, setActive, isLoaded } = useSignIn(); const [identifier, setIdentifier] = useState(''); const [password, setPassword] = useState(''); + const dispatch = useDispatch(); const handleLogin = async () => { if (!isLoaded) { @@ -32,8 +35,9 @@ const Login: React.FC = () => { Alert.alert('Username or email does not exist'); return; } - Alert.alert('Invalid password. Please try again.'); + Alert.alert(clerkMessage); } + dispatch(completeOnboarding()); }; const navigateToSignUp = () => { From ce6b3ad872a690aca3ce495b788bf1f8da73dc98 Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 12 Apr 2024 09:06:57 -0400 Subject: [PATCH 2/2] move completeonboarding up --- frontend/pages/Login.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/pages/Login.tsx b/frontend/pages/Login.tsx index 8160377d..629fd46e 100644 --- a/frontend/pages/Login.tsx +++ b/frontend/pages/Login.tsx @@ -28,6 +28,7 @@ const Login: React.FC = () => { }); await setActive({ session: completeSignIn.createdSessionId }); + dispatch(completeOnboarding()); } catch (error) { const clerkError = error as ClerkErrorResponse; const clerkMessage = clerkError.errors[0].message; @@ -37,7 +38,6 @@ const Login: React.FC = () => { } Alert.alert(clerkMessage); } - dispatch(completeOnboarding()); }; const navigateToSignUp = () => {