Skip to content

Commit

Permalink
Merge pull request #2026 from PolicyEngine/nikhilwoodruff/issue2025
Browse files Browse the repository at this point in the history
Policy output info modal appears every time
  • Loading branch information
anth-volk authored Sep 25, 2024
2 parents b2c2d42 + 443f2b8 commit d550b66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modals/PolicyImpactPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down

0 comments on commit d550b66

Please sign in to comment.