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 bar gets stuck when redirecting #7

Open
donnutdev opened this issue Jan 11, 2025 · 3 comments
Open

Progress bar gets stuck when redirecting #7

donnutdev opened this issue Jan 11, 2025 · 3 comments

Comments

@donnutdev
Copy link

Really liked this component because it made it easy to implement a progress bar in my app. I ran into an issue where whenever I redirected through hooks.server.ts, the progress bar gets stuck. It was for route protection.

A user clicked a button and the button sent the user to a different page using goto() where the invalidateAll option is set to true.
In the hooks.server.ts it does all the checks and redirects the user to the login page
But the progress bar gets stuck in the running state. (so it keeps inching forward until it reaches the maximum length)

A way I found to fix this is to use afterNavigate to complete the progress bar.

afterNavigate(() => {
    if (progressBarStartTimeout) {
        clearTimeout(progressBarStartTimeout);
        progressBarStartTimeout = null;
    }
    complete();
});
@allezxandre
Copy link
Member

What version are you using? #6 was expected to solve this issue.

@donnutdev
Copy link
Author

What version are you using? #6 was expected to solve this issue.

Latest release, v3.0.1

@hnrq
Copy link

hnrq commented Jan 18, 2025

+1, also happening here

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

No branches or pull requests

3 participants