Add null safety to handleLoggedOut() (#9062)

This commit is contained in:
Mac Siri 2020-07-02 04:51:37 -04:00 committed by GitHub
parent 7a8e77cbf3
commit 1662473174
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -277,10 +277,9 @@ function observeForReplyClick() {
}
function handleLoggedOut() {
const toggleButton = document.querySelector('.response-templates-button');
// global method from app/assets/javascripts/utilities/showModal.js
/* eslint-disable-next-line no-undef */
toggleButton.addEventListener('click', showModal);
document.querySelector('.response-templates-button')?.addEventListener('click', showModal);
}
/* eslint-enable no-alert */
/* eslint-enable no-restricted-globals */