From a815788af88bdfc2d4aa0770fc4ca2787506be28 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 6 Apr 2017 17:10:32 +0100 Subject: [PATCH] Fix issue where teamTokenMap was ignored for guests This was an issue because guests do not log in with a teamToken, it is implicitly set by MatrixChat when it mounts. The fix is to view_home_page when a login occurs and MatrixChat has this._teamToken set. --- src/components/structures/MatrixChat.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 7fe3b1ee38..b449ff3094 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -763,9 +763,11 @@ module.exports = React.createClass({ }); if (teamToken) { + // A team member has logged in, not a guest this._teamToken = teamToken; dis.dispatch({action: 'view_home_page'}); } else if (this._is_registered) { + // The user has just logged in after registering dis.dispatch({action: 'view_user_settings'}); } else { this._showScreenAfterLogin(); @@ -788,6 +790,10 @@ module.exports = React.createClass({ action: 'view_room', room_id: localStorage.getItem('mx_last_room_id'), }); + } else if (this._teamToken) { + // Team token might be set if we're a guest. + // Guests do not call _onLoggedIn with a teamToken + dis.dispatch({action: 'view_home_page'}); } else { dis.dispatch({action: 'view_room_directory'}); }