Skip to content

Commit

Permalink
Merge pull request #254 from Zekiah-A/main
Browse files Browse the repository at this point in the history
Fix captcha buttons no value
  • Loading branch information
Zekiah-A authored Mar 26, 2024
2 parents c0bca16 + db09586 commit d2b35e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@

for (let emoji of emojis) {
let buttonParent = document.createElement("button")
buttonParent.setAttribute("value", emoji)
let emojiImg = document.createElement("img")
emojiImg.src = `./tweemoji/${emoji.codePointAt(0).toString(16)}.png`
emojiImg.alt = emoji
Expand All @@ -980,8 +981,9 @@
captchaOptions.appendChild(buttonParent)

buttonParent.addEventListener("click", (event) => {
if (!event.target.value) return
call(send, ws, encoder.encode("\x10" + event.target.value))
const emojiValue = event.target.getAttribute("value")
if (!emojiValue) return console.error("Could not send captcha ressponse. No emoji value?")
call(send, ws, encoder.encode("\x10" + emojiValue))
captchaOptions.style.pointerEvents = "none"
})
}
Expand Down

0 comments on commit d2b35e7

Please sign in to comment.