Skip to content

Commit 8c2cfeb

Browse files
adhorodyskiclaude
andcommitted
rename ReportLifecycleHandler prop to reportID
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c46a8e3 commit 8c2cfeb

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/pages/inbox/ReportLifecycleHandler.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import CONST from '@src/CONST';
1414
import ONYXKEYS from '@src/ONYXKEYS';
1515

1616
type 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]);

src/pages/inbox/ReportScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
977977
shouldDisplaySearchRouter
978978
>
979979
<DragAndDropProvider isDisabled={isEditingDisabled}>
980-
<ReportLifecycleHandler reportIDFromRoute={reportIDFromRoute} />
980+
<ReportLifecycleHandler reportID={reportIDFromRoute} />
981981
<OfflineWithFeedback
982982
pendingAction={reportPendingAction ?? report?.pendingFields?.reimbursed}
983983
errors={reportErrors}

0 commit comments

Comments
 (0)