diff --git a/script.js b/script.js index b22df8b..56d31f7 100644 --- a/script.js +++ b/script.js @@ -24,9 +24,10 @@ const unlockDoor = (e, dID, aK, d) => { fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) .then(response => response.json()) - .then(data => () { + .then(data => { setTimeout(function() { messageContainer.innerHTML = "" }, 3000); messageContainer.innerHTML = data.message; + return; }) .catch(error => messageContainer.innerHTML = `Error: ${error}`) }