Avoiding redirectioning when restarting meteor


#1

When developing, everytime I save a file Meteor restarts (which is an excelent feature), however some pages have some validatons based on the user profile and they are redirected to landing page. I was checking and it seems that Meteor.users is not ready yet. How can I sort it?

SpecialController = MainController.extend({
  onBeforeAction: function(){
    const user = Meteor.users.findOne({_id: Meteor.userId()});
    if (user && user.profile.internalStatus == "valid") {
      this.next();
    } else {
     // the routers is sending here but it shouldn't.
      Router.go('dashboard');
    }
  }
});

#2

Run tracker that listens to user subscrtion readiness wtv it’s called, and call router go or next after subscription is ready. I don’t know if beforeaction runs in tracker.