Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch turbo:load after loading 404 response #960

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

domchristie
Copy link
Contributor

I'm not 100% sure if this is the correct approach, but as far as I can tell, this just dispatches the turbo:load event after rendering a 404.

Fixes #958

@afcapel
Copy link
Collaborator

afcapel commented Aug 24, 2023

I think this is correct. visitCompleted is basically clearing the busy state and firing the load event, both of which we want on load.

@domchristie happy to merge if you fix the merge conflict.

@domchristie
Copy link
Contributor Author

domchristie commented Aug 24, 2023

@afcapel I suppose the only consideration is if we want to maintain symmetry with complete i.e. call this.delegate.visitFailed(this) (which would then just call this.visitCompleted)

@domchristie domchristie force-pushed the dispatch_load_on_404 branch from 63412f8 to 9d5a20c Compare August 24, 2023 19:55
@afcapel
Copy link
Collaborator

afcapel commented Aug 25, 2023

@domchristie I think it's better if we avoid the indirection and keep the call to this.visitCompleted inside Visit itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

turbo:load is not dispatched when response status is 404/Not Found
2 participants