Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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