Skip to content

Commit

Permalink
fix for reset report fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Pujan92 committed Nov 30, 2022
1 parent b9bb4e6 commit d3cd179
Showing 1 changed file with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ class PopoverReportActionContextMenu extends React.Component {
* After Popover hides, call the registered onPopoverHide & onPopoverHideActionCallback callback and reset it
*/
runAndResetOnPopoverHide() {
this.onPopoverHide = this.runAndResetCallback(this.onPopoverHide);
this.onPopoverHideActionCallback = this.runAndResetCallback(this.onPopoverHideActionCallback);
this.setState({reportID: '0', reportAction: {}}, () => {
this.onPopoverHide = this.runAndResetCallback(this.onPopoverHide);
this.onPopoverHideActionCallback = this.runAndResetCallback(this.onPopoverHideActionCallback);
});
}

/**
Expand All @@ -212,24 +214,12 @@ class PopoverReportActionContextMenu extends React.Component {
hideContextMenu(onHideActionCallback) {
if (_.isFunction(onHideActionCallback)) {
this.onPopoverHideActionCallback = onHideActionCallback;
if (!this.state.isDeleteCommentConfirmModalVisible) {
this.setState({
reportID: '0',
reportAction: {},
selection: '',
reportActionDraftMessage: '',
isPopoverVisible: false,
});
}
} else {
this.setState({
reportID: '0',
reportAction: {},
selection: '',
reportActionDraftMessage: '',
isPopoverVisible: false,
});
}
this.setState({
selection: '',
reportActionDraftMessage: '',
isPopoverVisible: false,
});
}

/**
Expand Down

0 comments on commit d3cd179

Please sign in to comment.