diff options
Diffstat (limited to 'src/components/notifications/Notification.tsx')
-rw-r--r-- | src/components/notifications/Notification.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/components/notifications/Notification.tsx b/src/components/notifications/Notification.tsx index 301a3c90..94937053 100644 --- a/src/components/notifications/Notification.tsx +++ b/src/components/notifications/Notification.tsx @@ -2,15 +2,16 @@ import {useNavigation} from '@react-navigation/native'; import React, {useEffect, useState} from 'react'; import {Image, StyleSheet, Text, View} from 'react-native'; import {TouchableWithoutFeedback} from 'react-native-gesture-handler'; -import {useDispatch, useSelector, useStore} from 'react-redux'; +import {useDispatch, useStore} from 'react-redux'; import {loadAvatar, loadMomentThumbnail} from '../../services'; import {RootState} from '../../store/rootReducer'; -import {NotificationType, ScreenType} from '../../types'; +import {MomentType, NotificationType, ScreenType} from '../../types'; import {fetchUserX, SCREEN_HEIGHT, userXInStore} from '../../utils'; interface NotificationProps { item: NotificationType; screenType: ScreenType; + moments: MomentType[]; } const Notification: React.FC<NotificationProps> = (props) => { @@ -23,14 +24,11 @@ const Notification: React.FC<NotificationProps> = (props) => { unread, }, screenType, + moments: loggedInUserMoments, } = props; const navigation = useNavigation(); const state: RootState = useStore().getState(); const dispatch = useDispatch(); - const {moments: loggedInUserMoments} = - notification_type === 'CMT' - ? useSelector((state: RootState) => state.moments) - : {moments: undefined}; const [avatarURI, setAvatarURI] = useState<string | undefined>(undefined); const [momentURI, setMomentURI] = useState<string | undefined>(undefined); |