Skip to content

Commit

Permalink
use local storage on disclaimer modal
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMakka committed Dec 12, 2024
1 parent 3924be2 commit 1675732
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/components/DisclaimerModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export const DisclaimerModal: FC = () => {
useScrollLock(showModal);

useEffect(() => {
if (isNil(window?.sessionStorage?.getItem("disclaimer_accepted"))) {
if (isNil(window?.localStorage?.getItem("disclaimer_accepted"))) {
setShowModal(true);
}
}, []);

const setDisclaimer = async () => {
window.sessionStorage.setItem("disclaimer_accepted", "");
window.localStorage.setItem("disclaimer_accepted", "");
setShowModal(false);
};

Expand Down
4 changes: 2 additions & 2 deletions base/components/DisclaimerModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export const DisclaimerModal: FC = () => {
useScrollLock(showModal);

useEffect(() => {
if (isNil(window?.sessionStorage?.getItem("disclaimer_accepted"))) {
if (isNil(window?.localStorage?.getItem("disclaimer_accepted"))) {
setShowModal(true);
}
}, []);

const setDisclaimer = async () => {
window.sessionStorage.setItem("disclaimer_accepted", "");
window.localStorage.setItem("disclaimer_accepted", "");
setShowModal(false);
};

Expand Down

0 comments on commit 1675732

Please sign in to comment.