summaryrefslogtreecommitdiffstats
path: root/webapp/components/invite_member_modal.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-03-31 10:54:40 -0400
committerChristopher Speller <crspeller@gmail.com>2016-03-31 10:58:12 -0400
commit54a064de98f43c55bed429867493e6f5c7e97379 (patch)
treeb4991a5ce3856a804ccf870bbdef41f69649e779 /webapp/components/invite_member_modal.jsx
parentc8b2af62468c5d0906ba08d3e2a378681f99eb08 (diff)
downloadchat-54a064de98f43c55bed429867493e6f5c7e97379.tar.gz
chat-54a064de98f43c55bed429867493e6f5c7e97379.tar.bz2
chat-54a064de98f43c55bed429867493e6f5c7e97379.zip
Fixing username display in center channel
Diffstat (limited to 'webapp/components/invite_member_modal.jsx')
-rw-r--r--webapp/components/invite_member_modal.jsx18
1 files changed, 15 insertions, 3 deletions
diff --git a/webapp/components/invite_member_modal.jsx b/webapp/components/invite_member_modal.jsx
index 1f8fd6133..81c3a9629 100644
--- a/webapp/components/invite_member_modal.jsx
+++ b/webapp/components/invite_member_modal.jsx
@@ -50,6 +50,7 @@ class InviteMemberModal extends React.Component {
constructor(props) {
super(props);
+ this.teamChange = this.teamChange.bind(this);
this.handleToggle = this.handleToggle.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.handleHide = this.handleHide.bind(this);
@@ -68,16 +69,27 @@ class InviteMemberModal extends React.Component {
emailEnabled: global.window.mm_config.SendEmailNotifications === 'true',
userCreationEnabled: global.window.mm_config.EnableUserCreation === 'true',
showConfirmModal: false,
- isSendingEmails: false
+ isSendingEmails: false,
+ teamType: null
};
}
+ teamChange() {
+ const team = TeamStore.getCurrent();
+ const teamType = team ? team.type : null;
+ this.setState({
+ teamType
+ });
+ }
+
componentDidMount() {
ModalStore.addModalListener(ActionTypes.TOGGLE_INVITE_MEMBER_MODAL, this.handleToggle);
+ TeamStore.addChangeListener(this.teamChange);
}
componentWillUnmount() {
ModalStore.removeModalListener(ActionTypes.TOGGLE_INVITE_MEMBER_MODAL, this.handleToggle);
+ TeamStore.removeChangeListener(this.teamChange);
}
handleToggle(value) {
@@ -224,7 +236,7 @@ class InviteMemberModal extends React.Component {
var currentUser = UserStore.getCurrentUser();
const {formatMessage} = this.props.intl;
- if (currentUser != null) {
+ if (currentUser != null && this.state.teamType != null) {
var inviteSections = [];
var inviteIds = this.state.inviteIds;
for (var i = 0; i < inviteIds.length; i++) {
@@ -398,7 +410,7 @@ class InviteMemberModal extends React.Component {
);
} else if (this.state.userCreationEnabled) {
var teamInviteLink = null;
- if (currentUser && TeamStore.getCurrent().type === 'O') {
+ if (currentUser && this.state.teamType === 'O') {
var link = (
<a
href='#'