File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { useIsFocused } from '@react-navigation/native' ;
22import { useEffect } from 'react' ;
3- import { DeviceEventEmitter } from 'react-native' ;
43import useAppFocusEvent from '@hooks/useAppFocusEvent' ;
54import useBankAccountUnlockEffect from '@hooks/useBankAccountUnlockEffect' ;
65import { 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
You can’t perform that action at this time.
0 commit comments