iron-router-progress icon indicating copy to clipboard operation
iron-router-progress copied to clipboard

Rendering a landing page resulting in progress bar not completing.

Open davidmulligan opened this issue 10 years ago • 5 comments

Hi,

I am facing an issue I was hoping you could help with. I have a secured app that uses the progress bar and generally all is well, except when I have an onBeforeAction hook that will render a landing page if the user is not logged in.

When I visit a page and Im not secured, the landing page that is render the progress bar, as well as the spinner but neither then disappears. I assume this is because the hook has not completed as I don't have a next() method call. Not sure on the best way to solve this (still fairly new). Please see below for an example of my hook code:

var requireLogin = function() {
    if (!Meteor.user()) {
        if (Meteor.loggingIn()) {
            this.render(this.loadingTemplate);
        } else {
            this.render('landingPage');
        }
    } else {
        this.next();
    }
}
Router.onBeforeAction(requireLogin, {except: ['landingPage']});

Thanks

Dave

davidmulligan avatar Feb 18 '15 15:02 davidmulligan

@davidmulligan I am having the exact same issue.

sferoze avatar Mar 24 '15 03:03 sferoze

Any solutions on this? It is still getting stuck

sferoze avatar May 27 '15 16:05 sferoze

+1, any solutions?

rahulpowar avatar Jun 03 '15 18:06 rahulpowar

I have the same problem ?

marztres avatar Oct 08 '15 16:10 marztres

I usually called this.stop() or something similar manually, if you don't call this.next(). Must admit I don't quite remember the feature/syntax now, as it has been a while since I last had to implement such routes.

Multiply avatar Oct 08 '15 18:10 Multiply