diff options
author | Elias Nahum <nahumhbl@gmail.com> | 2016-08-09 17:05:59 -0500 |
---|---|---|
committer | Elias Nahum <nahumhbl@gmail.com> | 2016-08-09 17:05:59 -0500 |
commit | 805659239098a0b382a2a8bad704c2e91ab38ed6 (patch) | |
tree | e2c42b89d7ffc830bd9270cc65780fe470ccb4f4 /webapp/stores/team_store.jsx | |
parent | 7be82c2b279390d3659fbe74c7d3ccabc48a6dd8 (diff) | |
parent | ac2f75ac8fd4e2d7ae1de6703a156b9636d4b8f0 (diff) | |
download | chat-805659239098a0b382a2a8bad704c2e91ab38ed6.tar.gz chat-805659239098a0b382a2a8bad704c2e91ab38ed6.tar.bz2 chat-805659239098a0b382a2a8bad704c2e91ab38ed6.zip |
Merge branch 'release-3.3' RC3
Diffstat (limited to 'webapp/stores/team_store.jsx')
-rw-r--r-- | webapp/stores/team_store.jsx | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx index a482fa3a1..90cb66bb2 100644 --- a/webapp/stores/team_store.jsx +++ b/webapp/stores/team_store.jsx @@ -60,13 +60,7 @@ class TeamStoreClass extends EventEmitter { } getCurrentId() { - var team = this.get(this.currentTeamId); - - if (team) { - return team.id; - } - - return null; + return this.currentTeamId; } getCurrent() { @@ -80,10 +74,7 @@ class TeamStoreClass extends EventEmitter { } getCurrentTeamUrl() { - if (this.getCurrent()) { - return window.mm_config.SiteURL + '/' + this.getCurrent().name; - } - return ''; + return this.getTeamUrl(this.currentTeamId); } getCurrentTeamRelativeUrl() { @@ -97,7 +88,10 @@ class TeamStoreClass extends EventEmitter { const current = this.getCurrent(); if (current) { - return window.mm_config.SiteURL + '/signup_user_complete/?id=' + current.invite_id; + // can't call Utils.getSiteURL here because that introduces a circular dependency + const origin = window.mm_config.SiteURL || window.location.origin; + + return origin + '/signup_user_complete/?id=' + current.invite_id; } return ''; @@ -105,11 +99,15 @@ class TeamStoreClass extends EventEmitter { getTeamUrl(id) { const team = this.get(id); - if (team) { - return window.mm_config.SiteURL + '/' + team.name; + + if (!team) { + return ''; } - return ''; + // can't call Utils.getSiteURL here because that introduces a circular dependency + const origin = window.mm_config.SiteURL || window.location.origin; + + return origin + '/' + team.name; } saveTeam(team) { |