aboutsummaryrefslogtreecommitdiff
path: root/src/routes/Routes.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@thetaggid.com>2021-01-20 15:52:37 -0500
committerGitHub <noreply@github.com>2021-01-20 15:52:37 -0500
commit7b45e8d238f392183f3c1742f22495a2f9c6fb7f (patch)
treebab6621bf916e9efa0ce863cf49b649bd6ba6548 /src/routes/Routes.tsx
parenta64a0c53f108f8ea9c9ac0ba67c34ff82007271e (diff)
parent623bc69013c8fd173e49fb059eaba23c9219e0eb (diff)
Merge pull request #192 from ashmgarv/tma515-new-no-icon
[TMA - 515] New notifications icon and reordering of bottom navigation stack
Diffstat (limited to 'src/routes/Routes.tsx')
-rw-r--r--src/routes/Routes.tsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/routes/Routes.tsx b/src/routes/Routes.tsx
index 38a987f7..a14f1576 100644
--- a/src/routes/Routes.tsx
+++ b/src/routes/Routes.tsx
@@ -5,6 +5,8 @@ import {useSelector, useDispatch} from 'react-redux';
import {RootState} from '../store/rootReducer';
import {userLogin} from '../utils';
import SplashScreen from 'react-native-splash-screen';
+import messaging from '@react-native-firebase/messaging';
+import {updateNewNotificationReceived} from '../store/actions';
const Routes: React.FC = () => {
const {
@@ -24,7 +26,12 @@ const Routes: React.FC = () => {
* SplashScreen is the actual react-native's splash screen.
* We can hide / show it depending on our application needs.
*/
+
useEffect(() => {
+ messaging().onMessage(() => {
+ dispatch(updateNewNotificationReceived(true));
+ });
+
if (!userId) {
userLogin(dispatch, {userId: '', username: ''});
} else {