Skip to content

Commit

Permalink
Merge pull request #54329 from nkdengineer/fix/54322
Browse files Browse the repository at this point in the history
[CP Staging] fix: onboarding modal is not displayed in web

(cherry picked from commit dd93c76)

(CP triggered by mountiny)
  • Loading branch information
mountiny authored and OSBotify committed Dec 19, 2024
1 parent 73e6edf commit efb31e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
const {isOffline} = useNetwork();
const {shouldUseNarrowLayout, isInNarrowPaneModal} = useResponsiveLayout();
const {activeWorkspaceID} = useActiveWorkspace();
const lastAccessedReportIDRef = useRef(false);

const [modal] = useOnyx(ONYXKEYS.MODAL);
const [isComposerFullSize] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${reportIDFromRoute}`, {initialValue: false});
Expand Down Expand Up @@ -151,6 +152,10 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
return;
}

if (lastAccessedReportIDRef.current) {
return;
}

const lastAccessedReportID = ReportUtils.findLastAccessedReport(!canUseDefaultRooms, !!route.params.openOnAdminRoom, activeWorkspaceID)?.reportID;

// It's possible that reports aren't fully loaded yet
Expand All @@ -160,6 +165,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
}

Log.info(`[ReportScreen] no reportID found in params, setting it to lastAccessedReportID: ${lastAccessedReportID}`);
lastAccessedReportIDRef.current = true;
navigation.setParams({reportID: lastAccessedReportID});
}, [activeWorkspaceID, canUseDefaultRooms, navigation, route, finishedLoadingApp]);

Expand Down

0 comments on commit efb31e3

Please sign in to comment.