Skip to content

Commit

Permalink
Check for window.Turbo and add clarifying comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jayohms committed Feb 22, 2024
1 parent 2fe7e99 commit 68088a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion turbo/src/main/assets/js/turbo_bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
// Scroll to the anchor on the page
TurboSession.visitProposalScrollingToAnchor(location.toString(), JSON.stringify(options))
Turbo.navigator.view.scrollToAnchorFromLocation(location)
} else if (Turbo.navigator.location.href === location.href) {
} else if (window.Turbo && Turbo.navigator.location.href === location.href) {
// Refresh the page without native proposal
TurboSession.visitProposalIsPageRefresh(location.toString(), JSON.stringify(options))
this.visitLocationWithOptionsAndRestorationIdentifier(location, JSON.stringify(options), Turbo.navigator.restorationIdentifier)
} else {
Expand Down

0 comments on commit 68088a1

Please sign in to comment.