Skip to content

Commit

Permalink
fix merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanDylann committed Nov 23, 2023
1 parent 4f5a617 commit 2252f7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -14,16 +12,7 @@ const openOnAdminRoom = url ? new URL(url).searchParams.get('openOnAdminRoom') :

function BaseCentralPaneNavigator() {
return (
<Stack.Navigator
screenListeners={{
state: (e) => {
const reportID = lodashGet(e, 'data.state.routes[0].params.reportID', '');
if (reportID) {
Report.updateLastVisitTime(reportID);
}
},
}}
>
<Stack.Navigator>
<Stack.Screen
name={SCREENS.REPORT}
// We do it this way to avoid adding the url params to url
Expand Down
8 changes: 8 additions & 0 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ function ReportScreen({
const [listHeight, setListHeight] = useState(0);

const reportID = getReportID(route);

useEffect(() => {
if (!reportID) {
return;
}
Report.updateLastVisitTime(reportID);
}, [reportID]);

const {addWorkspaceRoomOrChatPendingAction, addWorkspaceRoomOrChatErrors} = ReportUtils.getReportOfflinePendingActionAndErrors(report);
const screenWrapperStyle = [styles.appContent, styles.flex1, {marginTop: viewportOffsetTop}];

Expand Down

0 comments on commit 2252f7c

Please sign in to comment.