Please help!
We are unable to access the editor for the Home Page of our site. The other pages are working fine. We have some custom code on the home page that allows the user to close a banner and not see it again until the next day. I’ve included the code snippet below and also a screenshot of what it looks like when we try to open the editor.
I have tried several different browsers.
After removing the code the editor works but we really need the banner to not pop up every time a user revisits the page. Is there a way to do this without affecting the editor?
Here is a read-only link to our site
<style>
/*The page-wrapper is initially hidden*/
.page-wrapper {
display:none;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.0/js.cookie.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
// get a reference to the page wrapper
const pageWrapper = document.querySelector(".page-wrapper");
// get a reference to the loading wrapper
const loadingWrapper = document.querySelector('.popia-banner_component');
// get the 'seenAnimation' cookie and store in a seenAnimation variable
const seenAnimation = Cookies.get('seenAnimation');
// if the 'seenAnimation' cookie is undefined
if(!seenAnimation){
// display the loading-wrapper
loadingWrapper.style.display = "flex";
// show the page-wrapper
// after a set duration of 3000 milliseconds
// (the time it takes to show the loading-wrapper in this case)
setTimeout(()=>{
pageWrapper.style.display = "block";
}, 1000);
// set the 'seenAnimation' cookie
Cookies.set('seenAnimation', 1, { expires: 1 });
}
else{
// else if the 'seenAnimation' cookie exists
// the user has already seen the animation
// and so
// hide the loading-wrapper
loadingWrapper.style.visibility = "hidden";
// show the page-wrapper
pageWrapper.style.display = "block";
}
});
</script>