Skip to content

Commit

Permalink
Fix missing DOM element check
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-darsow committed Nov 30, 2023
1 parent a4919a7 commit c9cb6e4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions static/scripts/dataprivacy/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ const USER_LANG_SET_KEY = 'USER_LANG_SET';
window.addEventListener('DOMContentLoaded', () => {
// show language settings if not set
if (getCookie(USER_LANG_SET_KEY) === 'true') {
document.querySelector('#language-screen').style.display = 'none';
document.querySelector('#welcome-screen').style.display = 'block';
if (document.querySelector('#language-screen')) {
document.querySelector('#language-screen').style.display = 'none';
}
if (document.querySelector('#welcome-screen')) {
document.querySelector('#welcome-screen').style.display = 'block';
}
} else {
document.querySelector('#language-screen').style.display = 'block';
document.querySelector('#welcome-screen').style.display = 'none';
if (document.querySelector('#language-screen')) {
document.querySelector('#language-screen').style.display = 'block';
}
if (document.querySelector('#welcome-screen')) {
document.querySelector('#welcome-screen').style.display = 'none';
}
$('select').trigger('chosen:updated');
}

Expand Down

0 comments on commit c9cb6e4

Please sign in to comment.