From fcdb7f36b7876e193a73d492a9ba115bc2966838 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Mon, 13 Jul 2015 20:07:13 +0530 Subject: [PATCH] optimize invite js code --- app/assets/javascripts/discourse/controllers/invite.js.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/invite.js.es6 b/app/assets/javascripts/discourse/controllers/invite.js.es6 index 3995b51f2..452967227 100644 --- a/app/assets/javascripts/discourse/controllers/invite.js.es6 +++ b/app/assets/javascripts/discourse/controllers/invite.js.es6 @@ -34,7 +34,7 @@ export default ObjectController.extend(Presence, ModalFunctionality, { // We are inviting to a topic if the model isn't the current user. // The current user would mean we are inviting to the forum in general. invitingToTopic: function() { - return this.get('model') !== Discourse.User.current(); + return this.get('model') !== this.currentUser; }.property('model'), topicId: Ember.computed.alias('model.id'), @@ -139,7 +139,7 @@ export default ObjectController.extend(Presence, ModalFunctionality, { return this.get('model').createInvite(this.get('emailOrUsername').trim(), groupNames).then(result => { this.setProperties({ saving: false, finished: true }); if (!this.get('invitingToTopic')) { - Discourse.Invite.findInvitedBy(Discourse.User.current(), userInvitedController.get('filter')).then(invite_model => { + Discourse.Invite.findInvitedBy(this.currentUser, userInvitedController.get('filter')).then(invite_model => { userInvitedController.set('model', invite_model); userInvitedController.set('totalInvites', invite_model.invites.length); });