Skip to content

Commit

Permalink
cleanup naming
Browse files Browse the repository at this point in the history
  • Loading branch information
akinwale committed May 14, 2023
1 parent 6b8e4bf commit f5453be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class AttachmentModal extends PureComponent {
*/
closeConfirmModal() {
this.setState({isAttachmentInvalid: false});
if (_.isFunction(this.props.onModalHide)) {
if (this.props.onModalHide) {
this.props.onModalHide();
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class ReportActionCompose extends React.Component {
this.showPopoverMenu = this.showPopoverMenu.bind(this);
this.comment = props.comment;
this.setShouldBlockEmojiCalcToFalse = this.setShouldBlockEmojiCalcToFalse.bind(this);
this.attachmentPreviewClosed = this.attachmentPreviewClosed.bind(this);
this.onAttachmentPreviewClosed = this.onAttachmentPreviewClosed.bind(this);

// React Native will retain focus on an input for native devices but web/mWeb behave differently so we have some focus management
// code that will refocus the compose input after a user closes a modal or some other actions, see usage of ReportActionComposeFocusManager
Expand Down Expand Up @@ -306,6 +306,14 @@ class ReportActionCompose extends React.Component {
this.calculateMentionSuggestion();
}

/**
* Event handler to update the state after the attachment preview is closed.
*/
onAttachmentPreviewClosed() {
this.setShouldBlockEmojiCalcToFalse();
this.setState({isAttachmentPreviewActive: false});
}

getDefaultSuggestionsValues() {
return {
suggestedEmojis: [],
Expand Down Expand Up @@ -856,14 +864,6 @@ class ReportActionCompose extends React.Component {
return true;
}

/**
* Event handler to update the state after the attachment preview is closed.
*/
attachmentPreviewClosed() {
this.setShouldBlockEmojiCalcToFalse();
this.setState({isAttachmentPreviewActive: false});
}

render() {
const reportParticipants = _.without(lodashGet(this.props.report, 'participants', []), this.props.currentUserPersonalDetails.login);
const participantsWithoutExpensifyEmails = _.difference(reportParticipants, CONST.EXPENSIFY_EMAILS);
Expand Down Expand Up @@ -903,7 +903,7 @@ class ReportActionCompose extends React.Component {
<AttachmentModal
headerTitle={this.props.translate('reportActionCompose.sendAttachment')}
onConfirm={this.addAttachment}
onModalHide={this.attachmentPreviewClosed}
onModalHide={this.onAttachmentPreviewClosed}
>
{({displayFileInModal}) => (
<>
Expand Down

0 comments on commit f5453be

Please sign in to comment.