Improved configuration export and fixed the bug of modal not closing on export.

This commit is contained in:
VakarisZ 2021-06-02 12:57:54 +03:00
parent 624fda10cb
commit 8b86e40259
2 changed files with 7 additions and 8 deletions

View File

@ -8,7 +8,7 @@ import '../../styles/components/configuration-components/ExportConfigModal.scss'
type Props = {
show: boolean,
onClick: () => void
onHide: () => void
}
const ConfigExportModal = (props: Props) => {
@ -45,12 +45,13 @@ const ConfigExportModal = (props: Props) => {
);
}
FileSaver.saveAs(configToExport, 'monkey.conf');
props.onHide();
})
}
return (
<Modal show={props.show}
onHide={props.onClick}
onHide={props.onHide}
size={'lg'}
className={'config-export-modal'}>
<Modal.Header closeButton>

View File

@ -228,16 +228,14 @@ class ConfigurePageComponent extends AuthComponent {
renderConfigExportModal = () => {
return (<ConfigExportModal show={this.state.showConfigExportModal}
onClick={this.onExport}/>)
}
onExport = () => {
this.setState({showConfigExportModal: false})
onHide={() => {
this.setState({showConfigExportModal: false});
}}/>);
}
renderConfigImportModal = () => {
return (<ConfigImportModal show={this.state.showConfigImportModal}
onClose={this.onClose}/>)
onClose={this.onClose}/>);
}
onClose = (importSuccessful) => {