fixing form submit

This commit is contained in:
rizky 2024-09-02 09:19:22 -07:00
parent f54e3c683c
commit e9254ece60
2 changed files with 4 additions and 12 deletions

View File

@ -169,16 +169,10 @@ export const Form: FC<FMProps> = (props) => {
}
return (
<form
onSubmit={(e) => {
onSubmit={async (e) => {
e.preventDefault();
e.stopPropagation();
fm.status = "saving";
fm.render();
fm.submit();
fm.status = "ready";
fm.render();
await fm.submit();
}}
ref={(el) => {
if (el) {

View File

@ -264,10 +264,8 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
toast.dismiss();
if (!success) {
fm.status = "ready";
fm.render();
}
if (fm.props.sonar === "on" && !isEditor) {
toast.dismiss();