Hi, I am trying to add some general app configuration for a project I am working on, and I decided to save this on the database so that I can change them from some other place if things go wrong with the app, the main reason I am doing this is to add a ‘maintenance mode’ whenever I am making changes to the app or during deploys or something like that, the way I’m trying do this is with a variable I set with this code:
Meteor.startup(function() {
Tracker.autorun(function () {
Meteor.subscribe('configuracion', function(){
configuracionGeneral = Configuracion.findOne({});
})
});
});
However, when I try to use it like this with iron router:
Router.onBeforeAction(function () {
console.log(configuracionGeneral);
if(configuracionGeneral.vynoHabilitado=='habilitado'){
this.next();
}else{
//Send to maintenance template
}
});
I can use the variable configuracionGeneral with no problem and I see it on the console, but when I change the values of it on the database the variable doesn’t change ‘reactively’, so I would like to know how can I change this variable ‘reactively’.