@@ -14,7 +14,7 @@ import CONST from '@src/CONST';
1414import ONYXKEYS from '@src/ONYXKEYS' ;
1515
1616type ReportLifecycleHandlerProps = {
17- reportIDFromRoute : string | undefined ;
17+ reportID : string | undefined ;
1818} ;
1919
2020/**
@@ -25,14 +25,14 @@ type ReportLifecycleHandlerProps = {
2525 * - Telemetry span cancellation on unmount
2626 * - Bank account unlock effect
2727 */
28- function ReportLifecycleHandler ( { reportIDFromRoute } : ReportLifecycleHandlerProps ) {
29- const reportID = getNonEmptyStringOnyxID ( reportIDFromRoute ) ;
28+ function ReportLifecycleHandler ( { reportID } : ReportLifecycleHandlerProps ) {
29+ const onyxReportID = getNonEmptyStringOnyxID ( reportID ) ;
3030 const isFocused = useIsFocused ( ) ;
3131 const prevIsFocused = usePrevious ( isFocused ) ;
3232 const { currentReportID : currentReportIDValue } = useCurrentReportIDState ( ) ;
33- const isTopMostReportId = currentReportIDValue === reportIDFromRoute ;
33+ const isTopMostReportId = currentReportIDValue === reportID ;
3434
35- const [ report ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ reportID } ` ) ;
35+ const [ report ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ onyxReportID } ` ) ;
3636 useBankAccountUnlockEffect ( report ) ;
3737
3838 // Hide emoji picker when screen loses focus
@@ -45,18 +45,18 @@ function ReportLifecycleHandler({reportIDFromRoute}: ReportLifecycleHandlerProps
4545
4646 // DeviceEventEmitter listener + telemetry cleanup
4747 useEffect ( ( ) => {
48- const skipOpenReportListener = DeviceEventEmitter . addListener ( `switchToPreExistingReport_${ reportID } ` , ( ) => { } ) ;
48+ const skipOpenReportListener = DeviceEventEmitter . addListener ( `switchToPreExistingReport_${ onyxReportID } ` , ( ) => { } ) ;
4949
5050 return ( ) => {
5151 skipOpenReportListener . remove ( ) ;
5252
5353 // Cancel telemetry span when user leaves the screen before full report data is loaded
54- cancelSpan ( `${ CONST . TELEMETRY . SPAN_OPEN_REPORT } _${ reportID } ` ) ;
54+ cancelSpan ( `${ CONST . TELEMETRY . SPAN_OPEN_REPORT } _${ onyxReportID } ` ) ;
5555
5656 // Cancel any pending send-message spans to prevent orphaned spans when navigating away
5757 cancelSpansByPrefix ( CONST . TELEMETRY . SPAN_SEND_MESSAGE ) ;
5858 } ;
59- } , [ reportID ] ) ;
59+ } , [ onyxReportID ] ) ;
6060
6161 // Clear notifications for the current report when it's opened and re-focused
6262 const clearNotifications = ( ) => {
@@ -65,7 +65,7 @@ function ReportLifecycleHandler({reportIDFromRoute}: ReportLifecycleHandlerProps
6565 return ;
6666 }
6767
68- clearReportNotifications ( reportID ) ;
68+ clearReportNotifications ( onyxReportID ) ;
6969 } ;
7070
7171 useEffect ( clearNotifications , [ clearNotifications ] ) ;
0 commit comments