Progress
This commit is contained in:
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Form, Space } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import {useLocation } from "react-router-dom";
|
||||
import {useSearchParams } from "react-router-dom";
|
||||
import "./form-fields-changed.styles.scss";
|
||||
import Prompt from "../../utils/prompt";
|
||||
|
||||
@@ -12,7 +12,7 @@ export default function FormsFieldChanged({ form, skipPrompt }) {
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
};
|
||||
const loc = useLocation();
|
||||
const loc = useSearchParams();
|
||||
//if (!form.isFieldsTouched()) return <></>;
|
||||
return (
|
||||
<Form.Item
|
||||
@@ -26,7 +26,7 @@ export default function FormsFieldChanged({ form, skipPrompt }) {
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: "100%" }}>
|
||||
<Prompt
|
||||
when={skipPrompt ? false : true}
|
||||
when={!skipPrompt}
|
||||
message={(location) => {
|
||||
if (loc.pathname === location.pathname) return false;
|
||||
return t("general.messages.unsavedchangespopup");
|
||||
|
||||
Reference in New Issue
Block a user