Skip to content

Commit

Permalink
Add failsafe to EOL banner
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga authored and evgeni committed Nov 29, 2023
1 parent 0598c8f commit 2edab1e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/overrides/layouts/base/eol_banner.html.erb.deface
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,20 @@ end %>
} else {
window.onload = function(e) {
// We have to do it from a callback because the element may not exist yet
document.getElementById('rails-app-content').classList.add('eol-banner');
const railsContainer = document.getElementById('rails-app-content');
if (railsContainer) {
railsContainer.classList.add('eol-banner');
}
}
}

const dismissButton = document.getElementById('satellite-oel-banner-dismiss-button');
dismissButton.addEventListener('click', () => {
element.style.display = 'none';
document.getElementById('rails-app-content').classList.remove('eol-banner');
const railsContainer = document.getElementById('rails-app-content');
if (railsContainer) {
railsContainer.classList.remove('eol-banner');
}
localStorage.setItem('satellite-eol-banner-dismissed', level);
const now = new Date();
const cutoff = new Date(now.getTime() + 30 * 24 * 60 * 60 * 1000);
Expand Down

0 comments on commit 2edab1e

Please sign in to comment.