@@ -70,9 +70,11 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto
70
70
const { isSmallScreenWidth} = useResponsiveLayout ( ) ;
71
71
const route = useRoute ( ) ;
72
72
const [ isDeleteTaskConfirmModalVisible , setIsDeleteTaskConfirmModalVisible ] = React . useState ( false ) ;
73
- const [ invoiceReceiverPolicy ] = useOnyx ( `${ ONYXKEYS . COLLECTION . POLICY } ${ report ?. invoiceReceiver && 'policyID' in report . invoiceReceiver ? report . invoiceReceiver . policyID : - 1 } ` ) ;
73
+ const [ invoiceReceiverPolicy ] = useOnyx (
74
+ `${ ONYXKEYS . COLLECTION . POLICY } ${ report ?. invoiceReceiver && 'policyID' in report . invoiceReceiver ? report . invoiceReceiver . policyID : CONST . DEFAULT_NUMBER_ID } ` ,
75
+ ) ;
74
76
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
75
- const [ parentReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report ?. parentReportID || report ?. reportID || '-1' } ` ) ;
77
+ const [ parentReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report ?. parentReportID || report ?. reportID } ` ) ;
76
78
const policy = usePolicy ( report ?. policyID ) ;
77
79
const [ personalDetails ] = useOnyx ( ONYXKEYS . PERSONAL_DETAILS_LIST ) ;
78
80
@@ -100,7 +102,7 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto
100
102
const reportDescription = Parser . htmlToText ( ReportUtils . getReportDescription ( report ) ) ;
101
103
const policyName = ReportUtils . getPolicyName ( report , true ) ;
102
104
const policyDescription = ReportUtils . getPolicyDescriptionText ( policy ) ;
103
- const isPersonalExpenseChat = isPolicyExpenseChat && ReportUtils . isCurrentUserSubmitter ( report ?. reportID ?? '' ) ;
105
+ const isPersonalExpenseChat = isPolicyExpenseChat && ReportUtils . isCurrentUserSubmitter ( report ?. reportID ) ;
104
106
const shouldShowSubtitle = ( ) => {
105
107
if ( ! subtitle ) {
106
108
return false ;
@@ -258,7 +260,7 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto
258
260
< PressableWithoutFeedback
259
261
onPress = { ( ) => {
260
262
if ( ReportUtils . canEditPolicyDescription ( policy ) ) {
261
- Navigation . navigate ( ROUTES . WORKSPACE_PROFILE_DESCRIPTION . getRoute ( report . policyID ?? '-1' ) ) ;
263
+ Navigation . navigate ( ROUTES . WORKSPACE_PROFILE_DESCRIPTION . getRoute ( ` ${ report . policyID ?? CONST . DEFAULT_NUMBER_ID } ` ) ) ;
262
264
return ;
263
265
}
264
266
Navigation . navigate ( ROUTES . REPORT_WITH_ID_DETAILS . getRoute ( reportID , Navigation . getReportRHPActiveRoute ( ) ) ) ;
0 commit comments