Skip to content

Commit

Permalink
Merge pull request hotwired#410 from riffdr/main
Browse files Browse the repository at this point in the history
Undefine check for custom element 'turbo-cable-stream-source'.
  • Loading branch information
kevinmcconnell authored Jan 3, 2023
2 parents a10ea27 + 2d587c4 commit 6b0b0d1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/assets/javascripts/turbo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4019,7 +4019,9 @@ class TurboCableStreamSourceElement extends HTMLElement {
}
}

customElements.define("turbo-cable-stream-source", TurboCableStreamSourceElement);
if (customElements.get("turbo-cable-stream-source") === undefined) {
customElements.define("turbo-cable-stream-source", TurboCableStreamSourceElement);
}

function encodeMethodIntoRequestBody(event) {
if (event.target instanceof HTMLFormElement) {
Expand Down
Loading

0 comments on commit 6b0b0d1

Please sign in to comment.