Skip to content

Commit

Permalink
CRDCDH-619 Switch from Session Storage to Cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
amattu2 committed Nov 21, 2023
1 parent e7b8e53 commit 23b55a7
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/components/SystemUseWarningOverlay/OverlayWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,24 @@ const OverlayWindow = () => {

const handleClose = () => {
setOpen(false);
sessionStorage.setItem('overlayLoad', 'true');
document.cookie = 'overlayLoad=true; path=/';
};

useEffect(() => {
if (!sessionStorage.length) {
if (document.cookie.indexOf('overlayLoad') === -1) {
setOpen(true);
}
}, [open]);

const content = text.content.map((item, index) => {
const textKey = `key_${index}`;
return (
<DialogContentText key={textKey} id="alert-dialog-description">
{item}
</DialogContentText>
);
});
const content = text.content.map((item, index) => {
const textKey = `key_${index}`;
return (
<DialogContentText key={textKey} id="alert-dialog-description">
{item}
</DialogContentText>
);
});

const list = text.list.map((item, index) => {
const listKey = `key_${index}`;
return (
Expand All @@ -177,8 +178,8 @@ const OverlayWindow = () => {
{item}
</ListItemText>
</ListItem>
);
});
);
});

return (
<ThemeProvider theme={theme}>
Expand Down

0 comments on commit 23b55a7

Please sign in to comment.