diff --git a/comps/form/Form.tsx b/comps/form/Form.tsx index 97bd6e7..acc2273 100755 --- a/comps/form/Form.tsx +++ b/comps/form/Form.tsx @@ -151,7 +151,13 @@ export const Form: FC = (props) => { onSubmit={(e) => { e.preventDefault(); e.stopPropagation(); + fm.status = "saving"; + fm.render(); + fm.submit(); + + fm.status = "ready"; + fm.render(); }} ref={(el) => { if (el) { @@ -168,7 +174,6 @@ export const Form: FC = (props) => { className={cx( "form c-flex-1 c-w-full c-h-full c-relative c-overflow-auto" )} - action="#" > {toaster_el && createPortal(, toaster_el)}
{ if (localStorage.getItem("user" + id_site)) { localStorage.removeItem("user" + id_site); } - if (url_login) navigate(url_login); + if (url_login !== getPathname()) + location.href = `${getBasename()}${url_login}`; }; diff --git a/utils/pathname.ts b/utils/pathname.ts index 9dbf862..849fbef 100755 --- a/utils/pathname.ts +++ b/utils/pathname.ts @@ -1,22 +1,22 @@ export const getPathname = (url?: string) => { - // if (["localhost", "prasi.avolut.com"].includes(location.hostname)) { - if ( - location.pathname.startsWith("/vi") || - location.pathname.startsWith("/prod") || - location.pathname.startsWith("/deploy") - ) { - const hash = location.hash; - if (url?.startsWith("/prod")) { - return "/" + url.split("/").slice(3).join("/"); - } + if (["prasi.avolut.com"].includes(location.hostname)) { + if ( + location.pathname.startsWith("/vi") || + location.pathname.startsWith("/prod") || + location.pathname.startsWith("/deploy") + ) { + const hash = location.hash; + if (url?.startsWith("/prod")) { + return "/" + url.split("/").slice(3).join("/"); + } - if (hash !== "") { - return "/" + location.pathname.split("/").slice(3).join("/") + hash; - } else { - return "/" + location.pathname.split("/").slice(3).join("/"); + if (hash !== "") { + return "/" + location.pathname.split("/").slice(3).join("/") + hash; + } else { + return "/" + location.pathname.split("/").slice(3).join("/"); + } } } - // } return location.pathname; };