Skip to content

Commit 8e753ef

Browse files
authored
Merge pull request #220 from ghiculescu/slow-redirect-fixx
Fix app breaking on cold boot redirects
2 parents c207eac + 05c7e1c commit 8e753ef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

turbo/src/main/kotlin/dev/hotwire/turbo/session/TurboSession.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,8 @@ class TurboSession internal constructor(
668668
reset()
669669
}
670670

671-
val willProposeThrottledVisit = shouldProposeThrottledVisit()
672-
if (shouldOverride && willProposeThrottledVisit) {
671+
val willProposeVisit = isColdBootRedirect || shouldProposeThrottledVisit()
672+
if (shouldOverride && willProposeVisit) {
673673
// Replace the cold boot destination on a redirect
674674
// since the original url isn't visitable.
675675
val options = when (isColdBootRedirect) {
@@ -683,7 +683,8 @@ class TurboSession internal constructor(
683683
"shouldOverrideUrlLoading",
684684
"location" to location,
685685
"shouldOverride" to shouldOverride,
686-
"willProposeThrottledVisit" to willProposeThrottledVisit
686+
"isColdBootRedirect" to isColdBootRedirect,
687+
"willProposeVisit" to willProposeVisit
687688
)
688689

689690
return shouldOverride

0 commit comments

Comments
 (0)