fixing form submit
This commit is contained in:
parent
f54e3c683c
commit
e9254ece60
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -264,10 +264,8 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
|
|||
|
||||
toast.dismiss();
|
||||
|
||||
if (!success) {
|
||||
fm.status = "ready";
|
||||
fm.render();
|
||||
}
|
||||
fm.status = "ready";
|
||||
fm.render();
|
||||
|
||||
if (fm.props.sonar === "on" && !isEditor) {
|
||||
toast.dismiss();
|
||||
|
|
|
|||
Loading…
Reference in New Issue