diff --git a/trigger.html b/trigger.html index e8abbc5..eb497a7 100644 --- a/trigger.html +++ b/trigger.html @@ -302,7 +302,7 @@ const unlockUrl = "https://ths.tnet.space/cgi-bin/unlock-main.cgi"; // make fetch function that calls cgi script with attributes (device id, api key, delay) - const unlockDoor = (dID, aK, d) => { + const unlockDoor = (e, dID, aK, d) => { fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) // fetch(unlockUrl) .then(response => response.text()) @@ -354,7 +354,7 @@ gotoMainScreen(); }); - unlockButton.addEventListener("click", unlockDoor(deviceID, apiKey, 0)); + unlockButton.addEventListener("click", (e) => unlockDoor(e, deviceID, apiKey, 0)); delayUnlockButton.addEventListener("click", function () { messageContainer.innerHTML = "Delay Unlock";