Closed glennfu closed 7 years ago
In my testing, updating Session: VisitDelegate
in Session.swift with...
func visitDidInitializeWebView(visit: Visit) {
initialized = true
delegate?.sessionDidLoadWebView(self)
// visit.visitable.visitableDidRender()
}
...fixed it for me. Everything seems to work fine after making that change. Are there any downsides to this?
I seem to be having this problem as well. In my viewDidLoad there is just:
presentVisitableForSession(session, URL: url)
The visitableDidRender gets fired twice.
I do wonder what the reason is that the session calls the method both on
visitDidRender
and visitDidInitializeWebView
I noticed this problem recently too, and addressed it in #45. Specifically, in https://github.com/turbolinks/turbolinks-ios/pull/45/commits/5598e70. I'll refresh my memory of the PR and merge it soon!
The fix for this has been merged into master and is in 1.0.3.
When the app is first loaded, and any time a pull-to-refresh is triggered,
visitableDidRender
gets called twice. Is this intentional? This is easy to reproduce in the Demo. Just open DemoViewController and add:You'll see it get called twice at the times I mentioned. When clicking a link, or navigating back, it's only called once as expected.
Following the callback chain it looks like
ColdBootVisit didFinishNavigation
gets called, triggering it, and thenColdBootVisit didLoadPageWithRestorationIdentifier
gets called, triggering it again.If this is intentional, is there a way to determine the difference in paths so that I can apply my changes in
visitableDidRender
only once?