diff options
Diffstat (limited to 'src/screens/onboarding')
| -rw-r--r-- | src/screens/onboarding/CategorySelection.tsx | 3 | ||||
| -rw-r--r-- | src/screens/onboarding/Login.tsx | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/screens/onboarding/CategorySelection.tsx b/src/screens/onboarding/CategorySelection.tsx index f92b7e39..b9677ed4 100644 --- a/src/screens/onboarding/CategorySelection.tsx +++ b/src/screens/onboarding/CategorySelection.tsx @@ -21,7 +21,7 @@ import {MOMENT_CATEGORIES} from '../../constants'; import {OnboardingStackParams} from '../../routes'; import {StackNavigationProp} from '@react-navigation/stack'; import {getTokenOrLogout, userLogin} from '../../utils'; -import {postMomentCategories} from '../../services'; +import {fcmService, postMomentCategories} from '../../services'; import {updateMomentCategories} from '../../store/actions/momentCategories'; import {ScrollView} from 'react-native-gesture-handler'; @@ -135,6 +135,7 @@ const CategorySelection: React.FC<CategorySelectionProps> = ({ const token = await getTokenOrLogout(dispatch); await postMomentCategories(selectedCategories, token); userLogin(dispatch, {userId: userId, username: username}); + fcmService.sendFcmTokenToServer(); } else { dispatch(updateMomentCategories(selectedCategories, true, userId)); navigation.goBack(); diff --git a/src/screens/onboarding/Login.tsx b/src/screens/onboarding/Login.tsx index 1315fdf5..3e59b00e 100644 --- a/src/screens/onboarding/Login.tsx +++ b/src/screens/onboarding/Login.tsx @@ -12,7 +12,7 @@ import { KeyboardAvoidingView, Platform, } from 'react-native'; - +import {fcmService} from '../../services'; import {OnboardingStackParams} from '../../routes/onboarding'; import {Background, TaggInput, SubmitButton} from '../../components'; import {usernameRegex, LOGIN_ENDPOINT} from '../../constants'; @@ -164,6 +164,7 @@ const Login: React.FC<LoginProps> = ({navigation}: LoginProps) => { await AsyncStorage.setItem('userId', data.UserID); await AsyncStorage.setItem('username', username); userLogin(dispatch, {userId: data.UserID, username}); + fcmService.sendFcmTokenToServer(); } catch (err) { setUser(NO_USER); console.log(data); |
