mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
pass onDone
as callback
This commit is contained in:
parent
b5d529a374
commit
014b19a906
@ -53,7 +53,7 @@ export default class Login extends React.Component {
|
|||||||
this.clearError()
|
this.clearError()
|
||||||
this.toggleLoading(true)
|
this.toggleLoading(true)
|
||||||
|
|
||||||
const loginProcess = await AuthModel.login(payload).catch((error) => {
|
await AuthModel.login(payload, () => this.onDone()).catch((error) => {
|
||||||
console.error(error, error.response)
|
console.error(error, error.response)
|
||||||
|
|
||||||
this.toggleLoading(false)
|
this.toggleLoading(false)
|
||||||
@ -61,21 +61,20 @@ export default class Login extends React.Component {
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
if (loginProcess) {
|
|
||||||
this.onDone()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onDone = () => {
|
onDone = async () => {
|
||||||
|
if (typeof this.props.close === "function") {
|
||||||
|
await this.props.close({
|
||||||
|
unlock: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof this.props.onDone === "function") {
|
if (typeof this.props.onDone === "function") {
|
||||||
this.props.onDone()
|
this.props.onDone()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof this.props.close === "function") {
|
return true
|
||||||
this.props.unlock()
|
|
||||||
this.props.close()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickRegister = () => {
|
onClickRegister = () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user