Skip to content

Commit

Permalink
Update profile route to use controller state #9, don't do localized l…
Browse files Browse the repository at this point in the history
…oading for now (see edit on #6)
  • Loading branch information
erasaur committed May 2, 2015
1 parent b7ec3e8 commit 625c2bb
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/routes/profile.js
Original file line number Diff line number Diff line change
@@ -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),
Expand All @@ -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 () {
Expand Down

0 comments on commit 625c2bb

Please sign in to comment.