diff --git a/frontend/app/components/Client/CustomFields/CustomFields.js b/frontend/app/components/Client/CustomFields/CustomFields.js index 2b875e439..081f11a58 100644 --- a/frontend/app/components/Client/CustomFields/CustomFields.js +++ b/frontend/app/components/Client/CustomFields/CustomFields.js @@ -23,7 +23,7 @@ import { confirm } from 'UI/Confirmation'; }) @withPageTitle('Metadata - OpenReplay Preferences') class CustomFields extends React.Component { - state = { showModal: false, currentSite: this.props.sites.get(0) }; + state = { showModal: false, currentSite: this.props.sites.get(0), deletingItem: null }; componentWillMount() { const activeSite = this.props.sites.get(0); @@ -60,15 +60,15 @@ class CustomFields extends React.Component { confirmation: `Are you sure you want to remove?` })) { const { currentSite } = this.state; - this.props.remove(currentSite.id, field.index).then(() => { - - }); + this.setState({ deletingItem: field.index }); + this.props.remove(currentSite.id, field.index) + .then(() => this.setState({ deletingItem: null })); } } render() { const { fields, field, loading } = this.props; - const { showModal, currentSite } = this.state; + const { showModal, currentSite, deletingItem } = this.state; return (