Fix logout by preventing the app from showing ErrorTeamsList screen (#5301)

This commit is contained in:
Elias Nahum 2021-04-09 20:26:10 -04:00 committed by GitHub
parent aecbe9af8e
commit c22e93ddb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -36,6 +36,7 @@ export default class ChannelBase extends PureComponent {
componentId: PropTypes.string.isRequired,
currentChannelId: PropTypes.string,
currentTeamId: PropTypes.string,
currentUserId: PropTypes.string,
disableTermsModal: PropTypes.bool,
isSupportedServer: PropTypes.bool,
isSystemAdmin: PropTypes.bool,
@ -132,7 +133,7 @@ export default class ChannelBase extends PureComponent {
});
}
if (prevProps.currentTeamId && !this.props.currentTeamId) {
if (this.props.currentUserId && prevProps.currentTeamId && !this.props.currentTeamId) {
this.props.actions.selectDefaultTeam();
}

View file

@ -22,6 +22,7 @@ import Channel from './channel';
function mapStateToProps(state) {
const currentTeam = getCurrentTeam(state);
const currentUserId = getCurrentUserId(state);
const roles = getCurrentUserId(state) ? getCurrentUserRoles(state) : '';
const isSystemAdmin = checkIsSystemAdmin(roles);
const serverVersion = Client4.getServerVersion() || getServerVersion(state);
@ -42,6 +43,7 @@ function mapStateToProps(state) {
return {
currentChannelId,
currentTeamId,
currentUserId,
isSupportedServer,
isSystemAdmin,
showTermsOfService: shouldShowTermsOfService(state),