kaalibro 1 жил өмнө
parent
commit
cee1a40651
1 өөрчлөгдсөн 3 нэмэгдсэн , 1 устгасан
  1. 3 1
      script.js

+ 3 - 1
script.js

@@ -163,11 +163,13 @@ document.addEventListener('keydown', function(e) {
     }
 
     if (isEsc) {
+        const globalPopup = document.querySelector('.global-popup');
         if (!globalPopup || globalPopup.style.display === "none") {
             interruptButton.click();
             e.preventDefault();
         } else {
-            closePopup();
+            if (!globalPopup) return;
+            globalPopup.style.display = "none";
         }
     }
 });