From 580e31a796b8b710bf0fe42d9b5273ec2acb6367 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Wed, 25 Mar 2020 17:57:55 +0100 Subject: [PATCH] Bug "multi-pause" fixed --- script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script.js b/script.js index ec53695..9587d33 100644 --- a/script.js +++ b/script.js @@ -326,6 +326,8 @@ async function startGame(gameID) { // Listen for key press events document.body.addEventListener("keydown", (ev) => { + if(!canvas.isConnected) + return; if(["ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp"].includes(ev.key)) key = ev.key;