|
@@ -59,6 +59,7 @@ import { NAVIGATION_PAGES } from 'src/types';
|
|
import { usePushNotification } from 'src/contexts/PushNotificationContext';
|
|
import { usePushNotification } from 'src/contexts/PushNotificationContext';
|
|
import ReactionsListModal from '../Components/ReactionsListModal';
|
|
import ReactionsListModal from '../Components/ReactionsListModal';
|
|
import { dismissChatNotifications } from '../utils';
|
|
import { dismissChatNotifications } from '../utils';
|
|
|
|
+import { useMessagesStore } from 'src/stores/unreadMessagesStore';
|
|
|
|
|
|
const options = {
|
|
const options = {
|
|
enableVibrateFallback: true,
|
|
enableVibrateFallback: true,
|
|
@@ -121,6 +122,7 @@ const ChatScreen = ({ route }: { route: any }) => {
|
|
const { isSubscribed } = usePushNotification();
|
|
const { isSubscribed } = usePushNotification();
|
|
const [isLoadingEarlier, setIsLoadingEarlier] = useState(false);
|
|
const [isLoadingEarlier, setIsLoadingEarlier] = useState(false);
|
|
const [hasMoreMessages, setHasMoreMessages] = useState(true);
|
|
const [hasMoreMessages, setHasMoreMessages] = useState(true);
|
|
|
|
+ const updateUnreadMessagesCount = useMessagesStore((state) => state.updateUnreadMessagesCount);
|
|
|
|
|
|
const appState = useRef(AppState.currentState);
|
|
const appState = useRef(AppState.currentState);
|
|
|
|
|
|
@@ -141,6 +143,7 @@ const ChatScreen = ({ route }: { route: any }) => {
|
|
|
|
|
|
return () => {
|
|
return () => {
|
|
if (unsubscribe) unsubscribe();
|
|
if (unsubscribe) unsubscribe();
|
|
|
|
+ updateUnreadMessagesCount();
|
|
};
|
|
};
|
|
}, [id]);
|
|
}, [id]);
|
|
|
|
|