mirror of https://github.com/openspug/spug
improve host Selector component
parent
f43c31d351
commit
7156d1a0da
|
@ -46,9 +46,14 @@ export default observer(function (props) {
|
||||||
|
|
||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
if (props.onOk) {
|
if (props.onOk) {
|
||||||
setLoading(true)
|
setLoading(true);
|
||||||
props.onOk(group, selectedRowKeys)
|
const res = props.onOk(group, selectedRowKeys);
|
||||||
.then(props.onCancel, () => setLoading(false))
|
if (res && res.then) {
|
||||||
|
res.then(props.onCancel, () => setLoading(false))
|
||||||
|
} else {
|
||||||
|
props.onCancel();
|
||||||
|
setLoading(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue