Skip to content

Commit

Permalink
Solved news letter popup multiple times loading issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
ygowthamr committed Nov 4, 2024
1 parent d8adb5e commit c584dd0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ window.onload = function() {
document.getElementById('popup-nl').style.display = 'none';
});

if (localStorage.getItem("noThanksClicked") === "true") {
document.getElementById('popup-nl').style.visibility = 'hidden';
}

// // Close the pop-up when clicking outside the pop-up content
// window.addEventListener('click', function(event) {
// const popupContent = document.querySelector('.popup-content'); // Select the popup content
Expand All @@ -31,4 +35,5 @@ window.onload = function() {
document.querySelector('.no-thanks-nl').addEventListener('click', function(event) {
event.preventDefault();
document.getElementById('popup-nl').style.display = 'none';
localStorage.setItem("noThanksClicked", "true");
});

0 comments on commit c584dd0

Please sign in to comment.