Fix logout by preventing the app from showing ErrorTeamsList screen (#5301)
This commit is contained in:
parent
aecbe9af8e
commit
c22e93ddb0
2 changed files with 4 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue