Skip to content

Commit

Permalink
UIIN-2497 Added method to handle closing of fast add record modal
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanDenis committed Nov 13, 2023
1 parent e26eed7 commit 8a94189
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/InstancesList/InstancesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,13 @@ class InstancesList extends React.Component {
}
}

toggleNewFastAddModal = ({ instanceRecord } = {}) => {
toggleNewFastAddModal = () => {
this.setState((state) => {
return { showNewFastAddModal: !state.showNewFastAddModal };
});
}

handleFastAddModalClose = ({ instanceRecord } = {}) => {
const {
history,
location,
Expand All @@ -561,9 +567,7 @@ class InstancesList extends React.Component {
});
}

this.setState((state) => {
return { showNewFastAddModal: !state.showNewFastAddModal };
});
this.toggleNewFastAddModal();
}

generateHoldingsIdReport = async (sendCallout) => {
Expand Down Expand Up @@ -729,7 +733,7 @@ class InstancesList extends React.Component {
{!checkIfUserInCentralTenant(stripes) && (
<Pluggable
id="clickable-create-inventory-records"
onClose={this.toggleNewFastAddModal}
onClose={this.handleFastAddModalClose}
open={this.state.showNewFastAddModal} // control the open modal via state var
renderTrigger={() => (
this.getActionItem({
Expand Down

0 comments on commit 8a94189

Please sign in to comment.