diff --git a/lib/routes/profile.js b/lib/routes/profile.js index 9be500f..fd2ea23 100644 --- a/lib/routes/profile.js +++ b/lib/routes/profile.js @@ -1,6 +1,6 @@ ProfileController = RouteController.extend({ subscriptions: function () { - var limit = Meteor.isClient ? Session.get('itemsLimit') : 15; + var limit = Meteor.isClient && this.state.get('itemsLimit') || 15; return [ subs.subscribe('userProfile', this.params._id), @@ -17,19 +17,17 @@ ProfileController = RouteController.extend({ 'following': 'profileFollowing' }; - Session.set('itemsLimit', 15); - Session.set('currentTab', tabs[query.tab] || 'profileComments'); + this.state.set('itemsLimit', 15); + this.state.set('currentTab', tabs[query.tab] || 'profileComments'); this.next(); }, action: function () { - this.render('nav', { to: 'nav' }); - this.render('profileButtons', { to: 'pageButtons' }); - this.render('profileHeader', { to: 'pageHeader' }); - this.render('profileNav', { to: 'pageNav' }); if (this.ready()) { + this.render('nav', { to: 'nav' }); + this.render('profileButtons', { to: 'pageButtons' }); + this.render('profileHeader', { to: 'pageHeader' }); + this.render('profileNav', { to: 'pageNav' }); this.render(); - } else { - this.render('loading'); } }, data: function () {