summaryrefslogtreecommitdiffstats
path: root/webapp/stores/team_store.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/stores/team_store.jsx')
-rw-r--r--webapp/stores/team_store.jsx28
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) {