iron router - Meteor IronRouter waitOn Infinite loop -
i have pretty standard setup meteor app using ironrouter. having problems this, attempting redirect page based on tokens in url coming third party website when user sent destination accounts.onlogin callback via router.go("some/fun/url"); waiton function runs endlessly. below pertinent part of setup.
first route redirecting to:
router.route("/shows/:show_acronym/sponsorships", { name:"sponsorshipssalesportal", data:function(){ return {show:shows.findone({acronym:this.params.show_acronym})}; }, waiton:function(){ console.log("wait on"); return [meteor.subscribe("show_by_acronym",this.params.show_acronym),meteor.subscribe("catalogue_products_by_acronym", this.params.show_acronym)]; } }); next relevant part of onlogin hook:
accounts.onlogin(function(){ if (session.get("showtoredirectto")){ console.log("sending sponsorship portal"); var ur ="/shows/"+session.get("showtoredirectto")+"/sponsorships" return router.go(ur); } }); when hits redirect, url changes , message "wait on" prints in console forever. know of solution this? prefer keep of subscriptions @ router level if @ possible.
thanks
you should return subscription cursors (meteor.subscribe(*)) in waiton return array. in case, "this.params.show_acronym" problem...
Comments
Post a Comment