mirror of
https://github.com/vale981/Vulcan
synced 2025-03-07 02:21:43 -05:00
26 lines
No EOL
844 B
JavaScript
26 lines
No EOL
844 B
JavaScript
// Session variables
|
|
Session.set('initialLoad', true);
|
|
Session.set('today', new Date());
|
|
Session.set('view', 'top');
|
|
Session.set('postsLimit', getSetting('postsPerPage', 10));
|
|
Session.set('sessionId', Meteor.default_connection._lastSessionId);
|
|
|
|
STATUS_PENDING=1;
|
|
STATUS_APPROVED=2;
|
|
STATUS_REJECTED=3;
|
|
|
|
|
|
|
|
// 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');
|
|
if(isAdmin(Meteor.user())){
|
|
// Subscribe to all users for now to make user selection autocomplete work
|
|
Meteor.subscribe('allUsersAdmin');
|
|
}
|
|
}
|
|
}); |