Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Hide disclaimer for the duration of the page session
Browse files Browse the repository at this point in the history
  • Loading branch information
nfelger committed Dec 3, 2021
1 parent aaf5800 commit de12d44
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/assets/js/disclaimer-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ const disclaimerModal = () => {
const sessionStorage = window.sessionStorage
const modal = document.getElementById('disclaimer-modal')
const modalCloseBtn = document.getElementById('close-disclaimer-modal')
modal.open()
modalCloseBtn.onclick = () => modal.close()

if (!sessionStorage.getItem('hideDisclaimer')) {
modal.open()
modalCloseBtn.onclick = () => {
sessionStorage.setItem('hideDisclaimer', 'true')
modal.close()
}
}
}

module.exports = disclaimerModal

0 comments on commit de12d44

Please sign in to comment.