small fix, prevent annoying error log when registering keydown esc from user custom js

This commit is contained in:
gutris1 2025-03-01 17:44:23 +07:00 committed by GitHub
parent d8688def65
commit 44446badc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,7 +182,7 @@ document.addEventListener('keydown', function(e) {
const lightboxModal = document.querySelector('#lightboxModal');
if (!globalPopup || globalPopup.style.display === 'none') {
if (document.activeElement === lightboxModal) return;
if (interruptButton.style.display === 'block') {
if (interruptButton && interruptButton.style.display === 'block') {
interruptButton.click();
e.preventDefault();
}