From 52bec30cbae29f165eec99179af52a59b6ef4db8 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 30 Mar 2021 14:11:35 -0400 Subject: passing username properly --- src/screens/onboarding/InvitationCodeVerification.tsx | 2 +- src/screens/onboarding/OnboardingStepThree.tsx | 3 +-- src/screens/onboarding/OnboardingStepTwo.tsx | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/screens/onboarding/InvitationCodeVerification.tsx b/src/screens/onboarding/InvitationCodeVerification.tsx index 7cd4b3bf..adaf6fe5 100644 --- a/src/screens/onboarding/InvitationCodeVerification.tsx +++ b/src/screens/onboarding/InvitationCodeVerification.tsx @@ -23,7 +23,6 @@ import { ERROR_INVALID_INVITATION_CODE, ERROR_INVLAID_CODE, ERROR_VERIFICATION_FAILED_SHORT, - SUCCESS_INVITATION_CODE, } from '../../constants/strings'; import {OnboardingStackParams} from '../../routes'; import {BackgroundGradientType} from '../../types'; @@ -83,6 +82,7 @@ const InvitationCodeVerification: React.FC = ({ Alert.alert(ERROR_INVALID_INVITATION_CODE); } } catch (error) { + console.log(error); Alert.alert( ERROR_VERIFICATION_FAILED_SHORT, ERROR_DOUBLE_CHECK_CONNECTION, diff --git a/src/screens/onboarding/OnboardingStepThree.tsx b/src/screens/onboarding/OnboardingStepThree.tsx index 29028421..53dd8b1f 100644 --- a/src/screens/onboarding/OnboardingStepThree.tsx +++ b/src/screens/onboarding/OnboardingStepThree.tsx @@ -216,8 +216,7 @@ const OnboardingStepThree: React.FC = ({ patchEditProfile(request, userId) .then((_) => navigation.navigate('InvitationCodeVerification', { - userId: route.params.userId, - username: username, + ...route.params, }), ) .catch((error) => { diff --git a/src/screens/onboarding/OnboardingStepTwo.tsx b/src/screens/onboarding/OnboardingStepTwo.tsx index a1100827..9bb27f8a 100644 --- a/src/screens/onboarding/OnboardingStepTwo.tsx +++ b/src/screens/onboarding/OnboardingStepTwo.tsx @@ -170,7 +170,7 @@ const OnboardingStepTwo: React.FC = ({ ); if (response) { const data = await response.json(); - const {token, UserID, username} = data; + const {token, UserID} = data; switch (response.status) { case 201: await AsyncStorage.setItem('token', token); -- cgit v1.2.3-70-g09d2 From e178c7fb313b742964a50f3f0a609e28478f466f Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 30 Mar 2021 15:57:45 -0400 Subject: removed log --- src/screens/onboarding/InvitationCodeVerification.tsx | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/screens/onboarding/InvitationCodeVerification.tsx b/src/screens/onboarding/InvitationCodeVerification.tsx index adaf6fe5..e160b4b7 100644 --- a/src/screens/onboarding/InvitationCodeVerification.tsx +++ b/src/screens/onboarding/InvitationCodeVerification.tsx @@ -82,7 +82,6 @@ const InvitationCodeVerification: React.FC = ({ Alert.alert(ERROR_INVALID_INVITATION_CODE); } } catch (error) { - console.log(error); Alert.alert( ERROR_VERIFICATION_FAILED_SHORT, ERROR_DOUBLE_CHECK_CONNECTION, -- cgit v1.2.3-70-g09d2 From 92c7cd4fbe78c6921089693f253a908bdc56e9c5 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 30 Mar 2021 15:58:43 -0400 Subject: cleaned up code --- src/screens/onboarding/OnboardingStepThree.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/screens/onboarding/OnboardingStepThree.tsx b/src/screens/onboarding/OnboardingStepThree.tsx index 53dd8b1f..5cf7993e 100644 --- a/src/screens/onboarding/OnboardingStepThree.tsx +++ b/src/screens/onboarding/OnboardingStepThree.tsx @@ -215,9 +215,7 @@ const OnboardingStepThree: React.FC = ({ patchEditProfile(request, userId) .then((_) => - navigation.navigate('InvitationCodeVerification', { - ...route.params, - }), + navigation.navigate('InvitationCodeVerification', route.params), ) .catch((error) => { Alert.alert(error); -- cgit v1.2.3-70-g09d2