summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'webapp')
-rw-r--r--webapp/routes/route_team.jsx13
1 files changed, 6 insertions, 7 deletions
diff --git a/webapp/routes/route_team.jsx b/webapp/routes/route_team.jsx
index d048cb5c9..f8ff3b593 100644
--- a/webapp/routes/route_team.jsx
+++ b/webapp/routes/route_team.jsx
@@ -103,18 +103,17 @@ function preNeedsTeam(nextState, replace, callback) {
return;
}
+ // If current team is set, then this is not first load
+ // The first load action pulls team unreads
+ if (TeamStore.getCurrentId()) {
+ getMyTeamUnreads()(dispatch, getState);
+ }
+
TeamStore.saveMyTeam(team);
BrowserStore.setGlobalItem('team', team.id);
TeamStore.emitChange();
GlobalActions.emitCloseRightHandSide();
- if (nextState.location.pathname.indexOf('/channels/') > -1 ||
- nextState.location.pathname.indexOf('/pl/') > -1 ||
- nextState.location.pathname.indexOf('/messages/') > -1) {
- getMyTeamUnreads()(dispatch, getState);
- fetchMyChannelsAndMembers(team.id)(dispatch, getState);
- }
-
const d1 = $.Deferred(); //eslint-disable-line new-cap
fetchMyChannelsAndMembers(team.id)(dispatch, getState).then(