Merge pull request #237 from answerdev/feat/1.0.6/ui

fix(Question): Dealing with Modal not disappearing after closing Ques…
This commit is contained in:
haitao.jarvis 2023-03-03 17:40:31 +08:00 committed by GitHub
commit 4c7f658a78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -47,7 +47,11 @@ const useReportModal = (callback?: () => void) => {
setShow(true);
});
};
const asyncCallback = () => {
setTimeout(() => {
callback?.();
});
};
const handleRadio = (val) => {
setInvalidState(false);
setContent({
@ -93,8 +97,8 @@ const useReportModal = (callback?: () => void) => {
close_type: reportType.type,
close_msg: content.value,
}).then(() => {
callback?.();
onClose();
asyncCallback();
});
return;
}
@ -109,8 +113,8 @@ const useReportModal = (callback?: () => void) => {
msg: t('flag_success', { keyPrefix: 'toast' }),
variant: 'warning',
});
callback?.();
onClose();
asyncCallback();
});
}
@ -121,8 +125,8 @@ const useReportModal = (callback?: () => void) => {
flagged_type: reportType.type,
id: params.id,
}).then(() => {
callback?.();
onClose();
asyncCallback();
});
}
};