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)

@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.

@afcapel afcapel merged commit 0826b81 into hotwired:main Aug 25, 2023
1 check passed
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