Merge pull request #460 from answerdev/feat/1.1.1/ui

fix(useCaptchaModal): Add `await` to all `close()` calls to prevent t…
This commit is contained in:
haitao.jarvis 2023-08-02 17:14:50 +08:00 committed by GitHub
commit c3b2e305ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -37,8 +37,8 @@ const Index: React.FC<IProps> = () => {
};
}
resendEmail(req)
.then(() => {
emailCaptcha.close();
.then(async () => {
await emailCaptcha.close();
setSuccess(true);
})
.catch((err) => {

View File

@ -49,8 +49,8 @@ const Index = () => {
}
getSearchResult(params)
.then((resp) => {
searchCaptcha.close();
.then(async (resp) => {
await searchCaptcha.close();
setData(resp);
})
.catch((err) => {

View File

@ -105,8 +105,8 @@ const Index: React.FC<Props> = ({ callback }) => {
}
register(reqParams)
.then((res) => {
emailCaptcha.close();
.then(async (res) => {
await emailCaptcha.close();
updateUser(res);
callback();
})