Skip to content

Commit

Permalink
refactor ms vals to consts
Browse files Browse the repository at this point in the history
  • Loading branch information
eastandwestwind committed Jun 9, 2023
1 parent 5fe53bd commit 8c64b95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clients/fides-js/src/components/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const Overlay: FunctionComponent<OverlayProps> = ({
fidesRegionString,
cookie,
}) => {
const delayBannerMilliseconds = 100;
const delayModalLinkMilliseconds = 200;
const hasMounted = useHasMounted();
const [bannerIsOpen, setBannerIsOpen] = useState(false);
const { instance, attributes } = useA11yDialog({
Expand All @@ -58,7 +60,7 @@ const Overlay: FunctionComponent<OverlayProps> = ({
useEffect(() => {
const delayBanner = setTimeout(() => {
setBannerIsOpen(true);
}, 100);
}, delayBannerMilliseconds);
return () => clearTimeout(delayBanner);
}, [setBannerIsOpen]);

Expand All @@ -83,7 +85,7 @@ const Overlay: FunctionComponent<OverlayProps> = ({
} else {
debugLog(options.debug, "Modal link element not found.");
}
}, 200);
}, delayModalLinkMilliseconds);
return () => clearTimeout(delayModalLinkBinding);
}, [options.modalLinkId, options.debug, handleOpenModal]);

Expand Down

0 comments on commit 8c64b95

Please sign in to comment.