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

fix(nuxt): stop loading indicator on navigation failure #21751

Merged
merged 10 commits into from
Jul 3, 2023

Conversation

huang-julien
Copy link
Member

@huang-julien huang-julien commented Jun 24, 2023

πŸ”— Linked issue

fix #21750

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Hi πŸ‘‹ this PR fixes #21750 on any navigation failure and when an router onError occurs

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

todo

  • test fixtures

@danielroe
Copy link
Member

Is it sufficient to use router.onError to solve the linked issue instead of adding a new hook?

@huang-julien
Copy link
Member Author

oh nice point, I think we need both.

When using abortNavigation() without any argument, it returns false and doesn't throw so doesn't goes into the router.onError hook.

But when having an error argument, it does not goes within app:navigation:aborted hook because it returns false instead of throwing.

@huang-julien huang-julien changed the title fix(nuxt): introduce app:navigation:aborted hook fix(nuxt): introduce app:navigation:aborted hook and stop loading indicator on navigation abort or error Jun 25, 2023
@huang-julien
Copy link
Member Author

hmmm... that's the kind of PR i'd like to test with nuxt-vitest πŸ˜…

@huang-julien huang-julien marked this pull request as ready for review June 28, 2023 03:56
@nuxt-studio
Copy link

nuxt-studio bot commented Jun 28, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview b65fe38

@huang-julien huang-julien changed the title fix(nuxt): introduce app:navigation:aborted hook and stop loading indicator on navigation abort or error fix(nuxt): stop loading indicator on navigation abort or error Jul 2, 2023
@huang-julien huang-julien marked this pull request as ready for review July 2, 2023 05:58
@danielroe danielroe changed the title fix(nuxt): stop loading indicator on navigation abort or error fix(nuxt): stop loading indicator on navigation failure Jul 3, 2023
@danielroe danielroe merged commit 9f5130d into nuxt:main Jul 3, 2023
28 checks passed
@github-actions github-actions bot mentioned this pull request Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<NuxtLoadingIndicator> gets stuck on abortNavigation from middleware
2 participants