@@ -4,7 +4,6 @@ import {View} from 'react-native';
4
4
import _ from 'underscore' ;
5
5
import lodashGet from 'lodash/get' ;
6
6
import { withOnyx } from 'react-native-onyx' ;
7
- import { useNavigation } from '@react-navigation/native' ;
8
7
import { useAnimatedRef } from 'react-native-reanimated' ;
9
8
import styles from '../../../../styles/styles' ;
10
9
import ONYXKEYS from '../../../../ONYXKEYS' ;
@@ -28,7 +27,6 @@ import ExceededCommentLength from '../../../../components/ExceededCommentLength'
28
27
import ReportDropUI from '../ReportDropUI' ;
29
28
import reportPropTypes from '../../../reportPropTypes' ;
30
29
import OfflineWithFeedback from '../../../../components/OfflineWithFeedback' ;
31
- import * as Welcome from '../../../../libs/actions/Welcome' ;
32
30
import SendButton from './SendButton' ;
33
31
import AttachmentPickerWithMenuItems from './AttachmentPickerWithMenuItems' ;
34
32
import ComposerWithSuggestions from './ComposerWithSuggestions' ;
@@ -110,7 +108,6 @@ function ReportActionCompose({
110
108
isCommentEmpty : isCommentEmptyProp ,
111
109
} ) {
112
110
const { translate} = useLocalize ( ) ;
113
- const navigation = useNavigation ( ) ;
114
111
const { isMediumScreenWidth, isSmallScreenWidth} = useWindowDimensions ( ) ;
115
112
const animatedRef = useAnimatedRef ( ) ;
116
113
const actionButtonRef = useRef ( null ) ;
@@ -288,32 +285,17 @@ function ReportActionCompose({
288
285
setIsFocused ( true ) ;
289
286
} , [ ] ) ;
290
287
291
- /**
292
- * Used to show Popover menu on Workspace chat at first sign-in
293
- * @returns {Boolean }
294
- */
295
- const showPopoverMenu = useCallback ( ( ) => {
296
- setMenuVisibility ( true ) ;
297
- return true ;
298
- } , [ ] ) ;
299
-
300
- useEffect ( ( ) => {
301
- // Shows Popover Menu on Workspace Chat at first sign-in
302
- if ( ! disabled ) {
303
- Welcome . show ( {
304
- routes : lodashGet ( navigation . getState ( ) , 'routes' , [ ] ) ,
305
- showPopoverMenu,
306
- } ) ;
307
- }
308
-
309
- return ( ) => {
288
+ // We are returning a callback here as we want to incoke the method on unmount only
289
+ useEffect (
290
+ ( ) => ( ) => {
310
291
if ( ! EmojiPickerActions . isActive ( report . reportID ) ) {
311
292
return ;
312
293
}
313
294
EmojiPickerActions . hideEmojiPicker ( ) ;
314
- } ;
295
+ } ,
315
296
// eslint-disable-next-line react-hooks/exhaustive-deps
316
- } , [ ] ) ;
297
+ [ ] ,
298
+ ) ;
317
299
318
300
const reportRecipientAcountIDs = ReportUtils . getReportRecipientAccountIDs ( report , currentUserPersonalDetails . accountID ) ;
319
301
const reportRecipient = personalDetails [ reportRecipientAcountIDs [ 0 ] ] ;
0 commit comments