Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/hooks/useSidebarOrderedReports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {getEmptyObject} from '@src/types/utils/EmptyObject';
import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems';
import useCurrentReportID from './useCurrentReportID';
import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails';
import useDeepCompareRef from './useDeepCompareRef';
import useDiffPrevious from './useDiffPrevious';
import useLocalize from './useLocalize';
import useOnyx from './useOnyx';
Expand Down Expand Up @@ -177,14 +176,12 @@ function SidebarOrderedReportsContextProvider({
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [getUpdatedReports, chatReports, derivedCurrentReportID, priorityMode, betas, policies, transactionViolations, reportNameValuePairs, reportAttributes, reportsDraftsUpdates]);

const deepComparedReportsToDisplayInLHN = useDeepCompareRef(reportsToDisplayInLHN);

useEffect(() => {
setCurrentReportsToDisplay(reportsToDisplayInLHN);
}, [reportsToDisplayInLHN]);

const getOrderedReportIDs = useCallback(
() => SidebarUtils.sortReportsToDisplayInLHN(deepComparedReportsToDisplayInLHN ?? {}, priorityMode, localeCompare, reportNameValuePairs, reportAttributes, drafts),
() => SidebarUtils.sortReportsToDisplayInLHN(reportsToDisplayInLHN, priorityMode, localeCompare, reportNameValuePairs, reportAttributes, drafts),
// Rule disabled intentionally - reports should be sorted only when the reportsToDisplayInLHN changes
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
[reportsToDisplayInLHN, localeCompare],
Expand Down
281 changes: 0 additions & 281 deletions tests/unit/useSidebarOrderedReportsTest.tsx

This file was deleted.

Loading