Vulcan/packages/telescope-notifications/lib/client/notifications-client.js
2014-09-20 09:57:09 +09:00

9 lines
384 B
JavaScript

// 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
Tracker.autorun(function() {
// userId() can be changed before user(), because loading profile takes time
if(Meteor.userId()) {
Meteor.subscribe('notifications');
}
});