Skip to content

Commit c3b2e30

Browse files
author
haitao.jarvis
authored
Merge pull request #460 from answerdev/feat/1.1.1/ui
fix(useCaptchaModal): Add `await` to all `close()` calls to prevent t…
2 parents 2d3ce32 + ed9a31d commit c3b2e30

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

ui/src/components/Unactivate/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const Index: React.FC<IProps> = () => {
3737
};
3838
}
3939
resendEmail(req)
40-
.then(() => {
41-
emailCaptcha.close();
40+
.then(async () => {
41+
await emailCaptcha.close();
4242
setSuccess(true);
4343
})
4444
.catch((err) => {

ui/src/pages/Search/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const Index = () => {
4949
}
5050

5151
getSearchResult(params)
52-
.then((resp) => {
53-
searchCaptcha.close();
52+
.then(async (resp) => {
53+
await searchCaptcha.close();
5454
setData(resp);
5555
})
5656
.catch((err) => {

ui/src/pages/Users/Register/components/SignUpForm/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ const Index: React.FC<Props> = ({ callback }) => {
105105
}
106106

107107
register(reqParams)
108-
.then((res) => {
109-
emailCaptcha.close();
108+
.then(async (res) => {
109+
await emailCaptcha.close();
110110
updateUser(res);
111111
callback();
112112
})

0 commit comments

Comments
 (0)