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

Progress Indicator not showing on $inertia.reload() #19

Open
zacksmash opened this issue Jul 14, 2021 · 5 comments
Open

Progress Indicator not showing on $inertia.reload() #19

zacksmash opened this issue Jul 14, 2021 · 5 comments

Comments

@zacksmash
Copy link

Versions:

  • @inertiajs/inertia version:0.9.4
  • @inertiajs/inertia-vue3 version: 0.4.7

Describe the problem:

I'm using $inertia.reload() in my mounted hook to fetch data that takes a bit longer to retrieve (3rd party API). However, doing this no longer shows the progress indicators, via InertiaProgress.

Steps to reproduce:

  1. Navigate to a page, with standard injected props.
  2. In your components mounted() lifecycle hook, make another request using the only option.
this.$inertia.reload({
      only: ['someApiData', 'someMoreApiData',],
})
@robsontenorio
Copy link

@zacksmash I think i am runnig similar issue. Did you solve it?

inertiajs/inertia#965 (comment)

@zacksmash
Copy link
Author

@robsontenorio I haven't yet, I ended up throwing a custom loading indicator for my reload() request, but it would be nice if Inertia could use the built in NProgress during that.

@robsontenorio
Copy link

@zacksmash I have tried custom loading, but no luck. Could you answer my comment with your solution?

inertiajs/inertia#965 (comment)

@zacksmash
Copy link
Author

@robsontenorio Sure, my doesn't look too different from your solution, in your comment, but here's what I have

data() {
    loading: true,
},
...
mounted() {
    this.$inertia.reload({
      only: ['someData'],
      onSuccess: () => this.loading = false
    })
  }

@robsontenorio
Copy link

@zacksmash Are you able to get that loading working when navigating to that target page using both approaches?

From any orgin page, in my case:

It works with <a href="/somepage"> go </a>
But not woks with this.$inertia.visit('/somepage')

EDIT:

  • Main problem here is onStart.
  • Just noticed we are using reversed logic for loading, so in your case won't be an issue.

@claudiodekker claudiodekker transferred this issue from inertiajs/inertia Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New 📑
Development

No branches or pull requests

2 participants