summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-05-11 11:44:45 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-11 11:44:45 -0400
commita574397a7256bed7738f499019f97ab468b5161d (patch)
treed1bc6ea6e38e08628c31a01b26ff87f243d7daa9 /webapp
parentd7197943f0e645c6a5a3c463ae9df2beab1256b9 (diff)
downloadchat-a574397a7256bed7738f499019f97ab468b5161d.tar.gz
chat-a574397a7256bed7738f499019f97ab468b5161d.tar.bz2
chat-a574397a7256bed7738f499019f97ab468b5161d.zip
Pull direct profiles when switching teams (#2965)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/root.jsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/webapp/root.jsx b/webapp/root.jsx
index 3f1edda38..2b54c2174 100644
--- a/webapp/root.jsx
+++ b/webapp/root.jsx
@@ -132,6 +132,7 @@ function preNeedsTeam(nextState, replace, callback) {
// for the current url.
var teamName = Utils.getTeamNameFromUrl();
var team = TeamStore.getByName(teamName);
+ const oldTeamId = TeamStore.getCurrentId();
if (!team) {
browserHistory.push('/');
@@ -143,6 +144,12 @@ function preNeedsTeam(nextState, replace, callback) {
TeamStore.saveMyTeam(team);
TeamStore.emitChange();
+ // If the old team id is null then we will already have the direct
+ // profiles from initial load
+ if (oldTeamId != null) {
+ AsyncClient.getDirectProfiles();
+ }
+
var d1 = $.Deferred(); //eslint-disable-line new-cap
var d2 = $.Deferred(); //eslint-disable-line new-cap