Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bug: Events other than "message" cant be displayed #36

Open
JasonXed opened this issue Feb 22, 2023 · 1 comment
Open

Bug: Events other than "message" cant be displayed #36

JasonXed opened this issue Feb 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JasonXed
Copy link

I was following the API guide to code a test chat widget until I hit a snag on the superchats. No matter what I tried it never gets triggered. I made sure that the code uses the correct listener like here:

window.addEventListener("onEventReceived", function (obj) {
  // snip
  if(obj.detail.listener == "superchat-latest"){
       // do something here
  }
}

So I opened up inspect and noticed some errors being thrown:
image

I looked into widget.html and noticed this particular line
image

Since text field is only present for messages and not anything else, it immediately throws an error and not dispatch the event. Manually editing the HTML to include an if condition fixed it.

Hopefully this can get patched soon.

@JasonXed JasonXed changed the title Bug: Events other than "messages" cant be displayed Bug: Events other than "message" cant be displayed Feb 22, 2023
@sigma-cw sigma-cw added the bug Something isn't working label Feb 22, 2023
@sigma-cw
Copy link
Owner

Will be fixed in the next version.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants