Skip to content

Commit b815594

Browse files
authored
Fix progress bar persisting when following a redirect (hotwired#1168)
1 parent aef1abd commit b815594

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/core/drive/visit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ export class Visit {
136136
complete() {
137137
if (this.state == VisitState.started) {
138138
this.recordTimingMetric(TimingMetric.visitEnd)
139+
this.adapter.visitCompleted(this)
139140
this.state = VisitState.completed
140141
this.followRedirect()
141142

142143
if (!this.followedRedirect) {
143-
this.adapter.visitCompleted(this)
144144
this.delegate.visitCompleted(this)
145145
}
146146
}

src/tests/functional/navigation_tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ test("following a redirection", async ({ page }) => {
379379
await nextBody(page)
380380
assert.equal(pathname(page.url()), "/src/tests/fixtures/one.html")
381381
assert.equal(await visitAction(page), "replace")
382+
await waitUntilNoSelector(page, ".turbo-progress-bar")
382383
})
383384

384385
test("clicking the back button after redirection", async ({ page }) => {

0 commit comments

Comments
 (0)