Vulcan/packages/telescope-notifications/lib/client/notifications-client.js

10 lines
384 B
JavaScript
Raw Normal View History

// 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');
}
});