Skip to content

Commit

Permalink
Merge pull request Expensify#26636 from Expensify/vit-dontShowTheQuic…
Browse files Browse the repository at this point in the history
…kMenu

Do not show the quick action in workspace chat automatically
  • Loading branch information
MonilBhavsar authored Sep 4, 2023
2 parents ebcc8d0 + d395fdf commit 53ac4ee
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions src/pages/home/report/ReportActionCompose/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {View} from 'react-native';
import _ from 'underscore';
import lodashGet from 'lodash/get';
import {withOnyx} from 'react-native-onyx';
import {useNavigation} from '@react-navigation/native';
import {useAnimatedRef} from 'react-native-reanimated';
import styles from '../../../../styles/styles';
import ONYXKEYS from '../../../../ONYXKEYS';
Expand All @@ -28,7 +27,6 @@ import ExceededCommentLength from '../../../../components/ExceededCommentLength'
import ReportDropUI from '../ReportDropUI';
import reportPropTypes from '../../../reportPropTypes';
import OfflineWithFeedback from '../../../../components/OfflineWithFeedback';
import * as Welcome from '../../../../libs/actions/Welcome';
import SendButton from './SendButton';
import AttachmentPickerWithMenuItems from './AttachmentPickerWithMenuItems';
import ComposerWithSuggestions from './ComposerWithSuggestions';
Expand Down Expand Up @@ -110,7 +108,6 @@ function ReportActionCompose({
isCommentEmpty: isCommentEmptyProp,
}) {
const {translate} = useLocalize();
const navigation = useNavigation();
const {isMediumScreenWidth, isSmallScreenWidth} = useWindowDimensions();
const animatedRef = useAnimatedRef();
const actionButtonRef = useRef(null);
Expand Down Expand Up @@ -288,32 +285,17 @@ function ReportActionCompose({
setIsFocused(true);
}, []);

/**
* Used to show Popover menu on Workspace chat at first sign-in
* @returns {Boolean}
*/
const showPopoverMenu = useCallback(() => {
setMenuVisibility(true);
return true;
}, []);

useEffect(() => {
// Shows Popover Menu on Workspace Chat at first sign-in
if (!disabled) {
Welcome.show({
routes: lodashGet(navigation.getState(), 'routes', []),
showPopoverMenu,
});
}

return () => {
// We are returning a callback here as we want to incoke the method on unmount only
useEffect(
() => () => {
if (!EmojiPickerActions.isActive(report.reportID)) {
return;
}
EmojiPickerActions.hideEmojiPicker();
};
},
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
[],
);

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

0 comments on commit 53ac4ee

Please sign in to comment.