diff --git a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.js b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.js index 5e4b916342d5..a1646011e560 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.js +++ b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.js @@ -1,10 +1,8 @@ import {createStackNavigator} from '@react-navigation/stack'; -import lodashGet from 'lodash/get'; import React from 'react'; import ReportScreenWrapper from '@libs/Navigation/AppNavigator/ReportScreenWrapper'; import getCurrentUrl from '@libs/Navigation/currentUrl'; import styles from '@styles/styles'; -import * as Report from '@userActions/Report'; import SCREENS from '@src/SCREENS'; const Stack = createStackNavigator(); @@ -14,16 +12,7 @@ const openOnAdminRoom = url ? new URL(url).searchParams.get('openOnAdminRoom') : function BaseCentralPaneNavigator() { return ( - { - const reportID = lodashGet(e, 'data.state.routes[0].params.reportID', ''); - if (reportID) { - Report.updateLastVisitTime(reportID); - } - }, - }} - > + { + if (!reportID) { + return; + } + Report.updateLastVisitTime(reportID); + }, [reportID]); + const {addWorkspaceRoomOrChatPendingAction, addWorkspaceRoomOrChatErrors} = ReportUtils.getReportOfflinePendingActionAndErrors(report); const screenWrapperStyle = [styles.appContent, styles.flex1, {marginTop: viewportOffsetTop}];