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 ( return (
<form <form
onSubmit={(e) => { onSubmit={async (e) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
fm.status = "saving"; await fm.submit();
fm.render();
fm.submit();
fm.status = "ready";
fm.render();
}} }}
ref={(el) => { ref={(el) => {
if (el) { if (el) {

View File

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