@@ -53,15 +53,15 @@ type DebugDetailsProps = {
5353} ;
5454
5555function DebugDetails ( { formType, data, policyHasEnabledTags, policyID, children, onSave, onDelete, validate} : DebugDetailsProps ) {
56- const { translate} = useLocalize ( ) ;
56+ const { translate, localeCompare } = useLocalize ( ) ;
5757 const styles = useThemeStyles ( ) ;
5858 const [ formDraftData ] = useOnyx ( ONYXKEYS . FORMS . DEBUG_DETAILS_FORM_DRAFT , { canBeMissing : true } ) ;
5959 const booleanFields = useMemo (
6060 ( ) =>
6161 Object . entries ( data ?? { } )
6262 . filter ( ( [ , value ] ) => typeof value === 'boolean' )
63- . sort ( ( a , b ) => a [ 0 ] . localeCompare ( b [ 0 ] ) ) as Array < [ string , boolean ] > ,
64- [ data ] ,
63+ . sort ( ( a , b ) => localeCompare ( a [ 0 ] , b [ 0 ] ) ) as Array < [ string , boolean ] > ,
64+ [ data , localeCompare ] ,
6565 ) ;
6666 const constantFields = useMemo (
6767 ( ) =>
@@ -73,15 +73,15 @@ function DebugDetails({formType, data, policyHasEnabledTags, policyID, children,
7373 }
7474 return DETAILS_CONSTANT_FIELDS [ formType ] . some ( ( { fieldName} ) => fieldName === entry [ 0 ] ) ;
7575 } )
76- . sort ( ( a , b ) => a [ 0 ] . localeCompare ( b [ 0 ] ) ) ,
77- [ data , formType , policyHasEnabledTags ] ,
76+ . sort ( ( a , b ) => localeCompare ( a [ 0 ] , b [ 0 ] ) ) ,
77+ [ data , formType , policyHasEnabledTags , localeCompare ] ,
7878 ) ;
7979 const numberFields = useMemo (
8080 ( ) =>
8181 Object . entries ( data ?? { } )
8282 . filter ( ( entry ) : entry is [ string , number ] => typeof entry [ 1 ] === 'number' )
83- . sort ( ( a , b ) => a [ 0 ] . localeCompare ( b [ 0 ] ) ) ,
84- [ data ] ,
83+ . sort ( ( a , b ) => localeCompare ( a [ 0 ] , b [ 0 ] ) ) ,
84+ [ data , localeCompare ] ,
8585 ) ;
8686 const textFields = useMemo (
8787 ( ) =>
@@ -93,8 +93,8 @@ function DebugDetails({formType, data, policyHasEnabledTags, policyID, children,
9393 ! DETAILS_DATETIME_FIELDS . includes ( entry [ 0 ] ) ,
9494 )
9595 . map ( ( [ key , value ] ) => [ key , DebugUtils . onyxDataToString ( value ) ] )
96- . sort ( ( a , b ) => ( a . at ( 0 ) ?? '' ) . localeCompare ( b . at ( 0 ) ?? '' ) ) ,
97- [ data , formType ] ,
96+ . sort ( ( a , b ) => localeCompare ( a . at ( 0 ) ?? '' , b . at ( 0 ) ?? '' ) ) ,
97+ [ data , formType , localeCompare ] ,
9898 ) ;
9999 const dateTimeFields = useMemo ( ( ) => Object . entries ( data ?? { } ) . filter ( ( entry ) : entry is [ string , string ] => DETAILS_DATETIME_FIELDS . includes ( entry [ 0 ] ) ) , [ data ] ) ;
100100
0 commit comments