@@ -10,6 +10,7 @@ import type * as OnyxTypes from '@src/types/onyx';
1010import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems' ;
1111import useCurrentReportID from './useCurrentReportID' ;
1212import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails' ;
13+ import useLocalize from './useLocalize' ;
1314import useOnyx from './useOnyx' ;
1415import usePrevious from './usePrevious' ;
1516import useResponsiveLayout from './useResponsiveLayout' ;
@@ -55,6 +56,7 @@ function SidebarOrderedReportsContextProvider({
5556 */
5657 currentReportIDForTests,
5758} : SidebarOrderedReportsContextProviderProps ) {
59+ const { localeCompare} = useLocalize ( ) ;
5860 const [ priorityMode = CONST . PRIORITY_MODE . DEFAULT ] = useOnyx ( ONYXKEYS . NVP_PRIORITY_MODE , { canBeMissing : true } ) ;
5961 const [ chatReports , { sourceValue : reportUpdates } ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT , { canBeMissing : true } ) ;
6062 const [ policies , { sourceValue : policiesUpdates } ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY , { selector : ( c ) => mapOnyxCollectionItems ( c , policySelector ) , canBeMissing : true } ) ;
@@ -173,10 +175,10 @@ function SidebarOrderedReportsContextProvider({
173175 } , [ reportsToDisplayInLHN ] ) ;
174176
175177 const getOrderedReportIDs = useCallback (
176- ( ) => SidebarUtils . sortReportsToDisplayInLHN ( reportsToDisplayInLHN , priorityMode , reportNameValuePairs , reportAttributes ) ,
178+ ( ) => SidebarUtils . sortReportsToDisplayInLHN ( reportsToDisplayInLHN , priorityMode , localeCompare , reportNameValuePairs , reportAttributes ) ,
177179 // Rule disabled intentionally - reports should be sorted only when the reportsToDisplayInLHN changes
178180 // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
179- [ reportsToDisplayInLHN ] ,
181+ [ reportsToDisplayInLHN , localeCompare ] ,
180182 ) ;
181183
182184 const orderedReportIDs = useMemo ( ( ) => getOrderedReportIDs ( ) , [ getOrderedReportIDs ] ) ;
0 commit comments