diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-03-26 18:08:13 -0400 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-03-26 18:08:57 -0400 |
| commit | cb1781dc3294ad56ecd538c7aa30d3a9583ea330 (patch) | |
| tree | 7091a32d459d8adffe9e79e67f24a214376f4ea3 /src/screens/onboarding/Login.tsx | |
| parent | b4c8fc3585feeeed4724a8629880ca798242055e (diff) | |
better enum type
Diffstat (limited to 'src/screens/onboarding/Login.tsx')
| -rw-r--r-- | src/screens/onboarding/Login.tsx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/screens/onboarding/Login.tsx b/src/screens/onboarding/Login.tsx index a5713fc5..e19e3e5f 100644 --- a/src/screens/onboarding/Login.tsx +++ b/src/screens/onboarding/Login.tsx @@ -27,7 +27,7 @@ import { import {OnboardingStackParams} from '../../routes/onboarding'; import {fcmService} from '../../services'; import {RootState} from '../../store/rootReducer'; -import {BackgroundGradientType} from '../../types'; +import {BackgroundGradientType, UniversityType} from '../../types'; import {normalize, userLogin} from '../../utils'; import UpdateRequired from './UpdateRequired'; @@ -167,22 +167,25 @@ const Login: React.FC<LoginProps> = ({navigation}: LoginProps) => { } catch (err) { Alert.alert(ERROR_INVALID_LOGIN); } - } else if (statusCode === 200 && data.university === '') { + } else if ( + statusCode === 200 && + data.university === UniversityType.Empty + ) { /** - * A user account was created during onboarding step 2 but user didn't - * finish step 3, thus does not have a universtiy. - * Redirecting user back to onboarding to finish the process - */ + * A user account was created during onboarding step 2 but user didn't + * finish step 3, thus does not have a universtiy. + * Redirecting user back to onboarding to finish the process + */ navigation.navigate('OnboardingStepThree', { userId: data.UserID, username: username, }); } else if (statusCode === 200 && !data.isOnboarded) { /** - * A user account was created and finished the onboarding process but - * did not have an invitation code at the time so the user's account - * is not activated (isOnboarded) yet. - */ + * A user account was created and finished the onboarding process but + * did not have an invitation code at the time so the user's account + * is not activated (isOnboarded) yet. + */ navigation.navigate('InvitationCodeVerification', { userId: data.UserID, username: username, |
