@@ -202,7 +202,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
202
202
} , [ getDatetimeToRelative , successfulDate ] ) ;
203
203
204
204
const integrationSpecificMenuItems = useMemo ( ( ) => {
205
- const sageIntacctEntityListLength = policy ?. connections ?. intacct ?. data ?. entities ?. length ;
205
+ const sageIntacctEntityList = policy ?. connections ?. intacct ?. data ?. entities ?? [ ] ;
206
206
const netSuiteSubsidiaryList = policy ?. connections ?. netsuite ?. options ?. data ?. subsidiaryList ?? [ ] ;
207
207
switch ( connectedIntegration ) {
208
208
case CONST . POLICY . CONNECTIONS . NAME . XERO :
@@ -242,23 +242,25 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
242
242
} ,
243
243
} ;
244
244
case CONST . POLICY . CONNECTIONS . NAME . SAGE_INTACCT :
245
- return {
246
- description : translate ( 'workspace.intacct.entity' ) ,
247
- iconRight : Expensicons . ArrowRight ,
248
- title : getCurrentSageIntacctEntityName ( policy ) ,
249
- wrapperStyle : [ styles . sectionMenuItemTopDescription ] ,
250
- titleStyle : styles . fontWeightNormal ,
251
- shouldShowRightIcon : ! ! sageIntacctEntityListLength ,
252
- shouldShowDescriptionOnTop : true ,
253
- pendingAction : policy ?. connections ?. intacct ?. config ?. pendingFields ?. entity ,
254
- brickRoadIndicator : policy ?. connections ?. intacct ?. config ?. errorFields ?. entity ? CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR : undefined ,
255
- onPress : ( ) => {
256
- if ( ! sageIntacctEntityListLength ) {
257
- return ;
258
- }
259
- Navigation . navigate ( ROUTES . POLICY_ACCOUNTING_SAGE_INTACCT_ENTITY . getRoute ( policyID ) ) ;
260
- } ,
261
- } ;
245
+ return ! sageIntacctEntityList . length
246
+ ? { }
247
+ : {
248
+ description : translate ( 'workspace.intacct.entity' ) ,
249
+ iconRight : Expensicons . ArrowRight ,
250
+ title : getCurrentSageIntacctEntityName ( policy ) ,
251
+ wrapperStyle : [ styles . sectionMenuItemTopDescription ] ,
252
+ titleStyle : styles . fontWeightNormal ,
253
+ shouldShowRightIcon : true ,
254
+ shouldShowDescriptionOnTop : true ,
255
+ pendingAction : policy ?. connections ?. intacct ?. config ?. pendingFields ?. entity ,
256
+ brickRoadIndicator : policy ?. connections ?. intacct ?. config ?. errorFields ?. entity ? CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR : undefined ,
257
+ onPress : ( ) => {
258
+ if ( ! sageIntacctEntityList . length ) {
259
+ return ;
260
+ }
261
+ Navigation . navigate ( ROUTES . POLICY_ACCOUNTING_SAGE_INTACCT_ENTITY . getRoute ( policyID ) ) ;
262
+ } ,
263
+ } ;
262
264
default :
263
265
return undefined ;
264
266
}
0 commit comments