forked from p15670423/monkey
Improved configuration export and fixed the bug of modal not closing on export.
This commit is contained in:
parent
624fda10cb
commit
8b86e40259
|
@ -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>
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue