Vulcan/client/main.js

26 lines
844 B
JavaScript
Raw Normal View History

// Session variables
2012-12-11 10:47:11 +09:00
Session.set('initialLoad', true);
2013-10-12 12:24:41 +09:00
Session.set('today', new Date());
2013-10-12 13:01:16 +09:00
Session.set('view', 'top');
2013-11-16 17:44:33 +09:00
Session.set('postsLimit', getSetting('postsPerPage', 10));
Session.set('sessionId', Meteor.default_connection._lastSessionId);
2012-12-11 10:47:11 +09:00
2014-02-18 14:46:53 +09:00
STATUS_PENDING=1;
STATUS_APPROVED=2;
STATUS_REJECTED=3;
2012-11-17 13:24:19 +09:00
// Notifications - only load if user is logged in
// Not mandatory, because server won't publish anything even if we try to load.
// Remember about Deps.autorun - user can log in and log out several times
Deps.autorun(function() {
// userId() can be changed before user(), because loading profile takes time
if(Meteor.userId()) {
Meteor.subscribe('notifications');
2014-02-18 14:46:53 +09:00
if(isAdmin(Meteor.user())){
// Subscribe to all users for now to make user selection autocomplete work
Meteor.subscribe('allUsersAdmin');
}
}
2014-02-18 14:46:53 +09:00
});