From a4867b7188bad1251597263258c5fcdb88a0fe1f Mon Sep 17 00:00:00 2001 From: Bryan Date: Sun, 20 Dec 2020 13:01:13 -0600 Subject: [PATCH] set timeout on message --- script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index 7324cc4..ae2b450 100644 --- a/script.js +++ b/script.js @@ -24,7 +24,8 @@ const unlockDoor = (e, dID, aK, d) => { fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) .then(response => response.json()) - .then(data => messageContainer.innerHTML = data.message) + .then(data => setTimeout(function() {messageContainer.innerHTML = ""}, 3000); + messageContainer.innerHTML = data.message) .catch(error => messageContainer.innerHTML = `Error: ${error}`) }