Skip to content

Commit a32f77d

Browse files
dabby9734wei2912
authored andcommitted
disable behaviour to not show modal after first appearance
1 parent c5ba66f commit a32f77d

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

components/PersonalisationModal.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const modalHeaderStyle = {
2323
const modalTextStyle = {};
2424

2525
const PersonalisationModal = ({ industries, clearFilters, addFilter }) => {
26-
const [open, setOpen] = useState<boolean>(false);
26+
const [open, setOpen] = useState<boolean>(true);
2727

2828
// handles toggling of the selected industries
2929
const [selectedIndustries, setSelectedIndustries] = useState<string[]>([]);
@@ -45,16 +45,8 @@ const PersonalisationModal = ({ industries, clearFilters, addFilter }) => {
4545
addFilter("industries", industry, "any");
4646
});
4747
setOpen(false);
48-
localStorage.setItem("ModalClosed", "true");
4948
};
5049

51-
// only open the modal if the user hasn't closed it before
52-
useEffect(() => {
53-
if (localStorage.getItem("ModalClosed") === null) {
54-
setOpen(true);
55-
}
56-
});
57-
5850
return (
5951
<Modal open={open} onClose={() => setOpen(false)}>
6052
<Box sx={modalStyle}>

0 commit comments

Comments
 (0)