diff --git a/src/modals/PolicyImpactPopup.jsx b/src/modals/PolicyImpactPopup.jsx index 3ec001c89..7967a7126 100644 --- a/src/modals/PolicyImpactPopup.jsx +++ b/src/modals/PolicyImpactPopup.jsx @@ -5,7 +5,9 @@ import { useAuth0 } from "@auth0/auth0-react"; import { getCookie, setCookie } from "../data/cookies"; export default function PolicyImpactPopup(props) { - const [needToOpenModal, setNeedToOpenModal] = useState(true); + const [needToOpenModal, setNeedToOpenModal] = useState( + !(getCookie("policyImpactPopup") === "disabled"), + ); const { metadata, showPolicyImpactPopup } = props; const { isAuthenticated } = useAuth0(); @@ -15,7 +17,7 @@ export default function PolicyImpactPopup(props) { // to prevent re-display const consentCookie = getCookie("consent"); if (isAuthenticated && consentCookie === "granted") { - setCookie("policyImpactPopup", "disabled"); + setCookie("policyImpactPopup", "disabled", 31536000, "/"); } // Destroy modal