Skip to content

Commit 53ac4ee

Browse files
authored
Merge pull request #26636 from Expensify/vit-dontShowTheQuickMenu
Do not show the quick action in workspace chat automatically
2 parents ebcc8d0 + d395fdf commit 53ac4ee

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

src/pages/home/report/ReportActionCompose/ReportActionCompose.js

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {View} from 'react-native';
44
import _ from 'underscore';
55
import lodashGet from 'lodash/get';
66
import {withOnyx} from 'react-native-onyx';
7-
import {useNavigation} from '@react-navigation/native';
87
import {useAnimatedRef} from 'react-native-reanimated';
98
import styles from '../../../../styles/styles';
109
import ONYXKEYS from '../../../../ONYXKEYS';
@@ -28,7 +27,6 @@ import ExceededCommentLength from '../../../../components/ExceededCommentLength'
2827
import ReportDropUI from '../ReportDropUI';
2928
import reportPropTypes from '../../../reportPropTypes';
3029
import OfflineWithFeedback from '../../../../components/OfflineWithFeedback';
31-
import * as Welcome from '../../../../libs/actions/Welcome';
3230
import SendButton from './SendButton';
3331
import AttachmentPickerWithMenuItems from './AttachmentPickerWithMenuItems';
3432
import ComposerWithSuggestions from './ComposerWithSuggestions';
@@ -110,7 +108,6 @@ function ReportActionCompose({
110108
isCommentEmpty: isCommentEmptyProp,
111109
}) {
112110
const {translate} = useLocalize();
113-
const navigation = useNavigation();
114111
const {isMediumScreenWidth, isSmallScreenWidth} = useWindowDimensions();
115112
const animatedRef = useAnimatedRef();
116113
const actionButtonRef = useRef(null);
@@ -288,32 +285,17 @@ function ReportActionCompose({
288285
setIsFocused(true);
289286
}, []);
290287

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+
() => () => {
310291
if (!EmojiPickerActions.isActive(report.reportID)) {
311292
return;
312293
}
313294
EmojiPickerActions.hideEmojiPicker();
314-
};
295+
},
315296
// eslint-disable-next-line react-hooks/exhaustive-deps
316-
}, []);
297+
[],
298+
);
317299

318300
const reportRecipientAcountIDs = ReportUtils.getReportRecipientAccountIDs(report, currentUserPersonalDetails.accountID);
319301
const reportRecipient = personalDetails[reportRecipientAcountIDs[0]];

0 commit comments

Comments
 (0)