Skip to content

Commit b5220e5

Browse files
adhorodyskiclaude
andcommitted
remove dead switchToPreExistingReport listener
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8c2cfeb commit b5220e5

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/pages/inbox/ReportLifecycleHandler.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {useIsFocused} from '@react-navigation/native';
22
import {useEffect} from 'react';
3-
import {DeviceEventEmitter} from 'react-native';
43
import useAppFocusEvent from '@hooks/useAppFocusEvent';
54
import useBankAccountUnlockEffect from '@hooks/useBankAccountUnlockEffect';
65
import {useCurrentReportIDState} from '@hooks/useCurrentReportID';
@@ -21,7 +20,6 @@ type ReportLifecycleHandlerProps = {
2120
* Component that does not render anything. Handles screen lifecycle side effects:
2221
* - Hide emoji picker when screen loses focus
2322
* - Clear notifications when report is opened/re-focused
24-
* - DeviceEventEmitter listener for switchToPreExistingReport
2523
* - Telemetry span cancellation on unmount
2624
* - Bank account unlock effect
2725
*/
@@ -43,13 +41,9 @@ function ReportLifecycleHandler({reportID}: ReportLifecycleHandlerProps) {
4341
hideEmojiPicker(true);
4442
}, [prevIsFocused, isFocused]);
4543

46-
// DeviceEventEmitter listener + telemetry cleanup
44+
// Telemetry cleanup
4745
useEffect(() => {
48-
const skipOpenReportListener = DeviceEventEmitter.addListener(`switchToPreExistingReport_${onyxReportID}`, () => {});
49-
5046
return () => {
51-
skipOpenReportListener.remove();
52-
5347
// Cancel telemetry span when user leaves the screen before full report data is loaded
5448
cancelSpan(`${CONST.TELEMETRY.SPAN_OPEN_REPORT}_${onyxReportID}`);
5549

0 commit comments

Comments
 (0)