Skip to content

Commit

Permalink
APIDOC-448: FIX Coockies Banner + setInterval()
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoranieri committed Sep 20, 2022
1 parent 795d5bf commit 86f2b78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/nexmo_developer/app/webpacker/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,23 @@ $(document).ready(function() {

// Manually close Coockies banner in Chrome 1 - 79
if (!!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime)) {
setTimeout(function() {
let checkCoockiesBanner = setInterval(function() {
const coockiesBanner = document.querySelector('.optanon-alert-box-wrapper')
if (coockiesBanner) {
if (sessionStorage.getItem('coockiesBanner') === 'clicked') {
coockiesBanner.style.display = 'none'
clearInterval(checkCoockiesBanner)
checkCoockiesBanner = 0
}
const buttons = coockiesBanner.querySelectorAll('button')
buttons.forEach((button) => {
button.addEventListener('click', () => sessionStorage.setItem('coockiesBanner', 'clicked'))
})
}
}, 100)
}, 50)

setTimeout(() => {
clearInterval(checkCoockiesBanner)
}, 8000)
}
});
2 changes: 1 addition & 1 deletion lib/nexmo_developer/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module NexmoDeveloper
VERSION = '0.5.9'.freeze
VERSION = '0.5.10'.freeze
end

0 comments on commit 86f2b78

Please sign in to comment.