mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
optimize invite js code
This commit is contained in:
parent
8a33fb9bd5
commit
fcdb7f36b7
1 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@ export default ObjectController.extend(Presence, ModalFunctionality, {
|
||||||
// We are inviting to a topic if the model isn't the current user.
|
// 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.
|
// The current user would mean we are inviting to the forum in general.
|
||||||
invitingToTopic: function() {
|
invitingToTopic: function() {
|
||||||
return this.get('model') !== Discourse.User.current();
|
return this.get('model') !== this.currentUser;
|
||||||
}.property('model'),
|
}.property('model'),
|
||||||
|
|
||||||
topicId: Ember.computed.alias('model.id'),
|
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 => {
|
return this.get('model').createInvite(this.get('emailOrUsername').trim(), groupNames).then(result => {
|
||||||
this.setProperties({ saving: false, finished: true });
|
this.setProperties({ saving: false, finished: true });
|
||||||
if (!this.get('invitingToTopic')) {
|
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('model', invite_model);
|
||||||
userInvitedController.set('totalInvites', invite_model.invites.length);
|
userInvitedController.set('totalInvites', invite_model.invites.length);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue