Skip to content

Commit

Permalink
Fix: When determining whether Turbo exists it throws undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioalcaraz committed May 3, 2024
1 parent 69d9931 commit 15f82df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webroot/js/inject-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ if (elem) {
if (!win.debugKitListenersApplied) {
// Add support for turbo DOMContentLoaded alternative
// see https://turbo.hotwired.dev/reference/events#turbo%3Aload
const loadedEvent = Turbo ? 'turbo:load' : 'DOMContentLoaded';
const loadedEvent = typeof Turbo !== 'undefined' && Turbo !== null ? 'turbo:load' : 'DOMContentLoaded';
doc.addEventListener(loadedEvent, onReady, false);
doc.addEventListener(loadedEvent, proxyAjaxOpen, false);
doc.addEventListener(loadedEvent, proxyAjaxSend, false);
Expand Down

0 comments on commit 15f82df

Please sign in to comment.