set timeout on message
parent
42952d70c4
commit
a4867b7188
|
|
@ -24,7 +24,8 @@
|
||||||
const unlockDoor = (e, dID, aK, d) => {
|
const unlockDoor = (e, dID, aK, d) => {
|
||||||
fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`)
|
fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`)
|
||||||
.then(response => response.json())
|
.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}`)
|
.catch(error => messageContainer.innerHTML = `Error: ${error}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue