Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jun 27, 2024
1 parent 6ed8133 commit 51c85dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useLastAccessedReportID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default function useLastAccessedReportID(shouldOpenOnAdminRoom: boolean)
)?.reportID;
}, [activeWorkspaceID, canUseDefaultRooms, shouldOpenOnAdminRoom]);

// We need access to all the data from these useOnyx calls, but we don't want to re-render the consuming component
// unless the derived value (lastAccessedReportID) changes. To address these, we'll wrap everything with
// We need access to all the data from these Onyx.connect calls, but we don't want to re-render the consuming component
// unless the derived value (lastAccessedReportID) changes. To address these, we'll wrap everything with useSyncExternalStore
return useSyncExternalStore(addSubscriber, getSnapshot);
}
2 changes: 1 addition & 1 deletion src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function ReportScreen({
const isLoadingReportOnyx = isLoadingOnyxValue(reportResult);
const permissions = useDeepCompareRef(reportOnyx?.permissions);

// check if there's a reportID in the route. If not, set it to the last accessed reportID
// Check if there's a reportID in the route. If not, set it to the last accessed reportID
const lastAccessedReportID = useLastAccessedReportID(!!route.params.openOnAdminRoom);
useEffect(() => {
// Don't update if there is a reportID in the params already
Expand Down

0 comments on commit 51c85dd

Please sign in to comment.