Fix logout/login issue (#707)
This commit is contained in:
parent
c2c56737bf
commit
2fa7d7dd84
3 changed files with 25 additions and 21 deletions
|
|
@ -79,7 +79,7 @@ class Channel extends PureComponent {
|
|||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.currentTeam && nextProps.currentTeam && this.props.currentTeam.id !== nextProps.currentTeam.id) {
|
||||
if (nextProps.currentTeam.id && this.props.currentTeam.id !== nextProps.currentTeam.id) {
|
||||
const teamId = nextProps.currentTeam.id;
|
||||
this.loadChannels(teamId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class ChannelPostList extends PureComponent {
|
|||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
// Show the loader if the channel names change
|
||||
// Show the loader if the channel id change
|
||||
if (this.props.currentChannelId !== nextProps.currentChannelId) {
|
||||
this.setState({
|
||||
loaderOpacity: new Animated.Value(1)
|
||||
|
|
|
|||
|
|
@ -89,27 +89,31 @@ class LoginOptions extends PureComponent {
|
|||
|
||||
renderGitlabOption = () => {
|
||||
const {config, serverVersion} = this.props;
|
||||
const version = serverVersion.match(/^[0-9]*.[0-9]*.[0-9]*(-[a-zA-Z0-9.-]*)?/g)[0];
|
||||
if (config.EnableSignUpWithGitLab === 'true' && semver.valid(version) && semver.gte(version, 'v3.10.0')) {
|
||||
return (
|
||||
<Button
|
||||
key='gitlab'
|
||||
onPress={() => preventDoubleTap(this.goToSSO, this, ViewTypes.GITLAB)}
|
||||
containerStyle={[GlobalStyles.signupButton, {backgroundColor: '#548'}]}
|
||||
>
|
||||
<Image
|
||||
source={gitlab}
|
||||
style={{height: 18, marginRight: 5, width: 18}}
|
||||
/>
|
||||
<Text
|
||||
style={[GlobalStyles.signupButtonText, {color: 'white'}]}
|
||||
const match = serverVersion.match(/^[0-9]*.[0-9]*.[0-9]*(-[a-zA-Z0-9.-]*)?/g);
|
||||
if (match) {
|
||||
const version = match[0];
|
||||
if (config.EnableSignUpWithGitLab === 'true' && semver.valid(version) && semver.gte(version, 'v3.10.0')) {
|
||||
return (
|
||||
<Button
|
||||
key='gitlab'
|
||||
onPress={() => preventDoubleTap(this.goToSSO, this, ViewTypes.GITLAB)}
|
||||
containerStyle={[GlobalStyles.signupButton, {backgroundColor: '#548'}]}
|
||||
>
|
||||
{'GitLab'}
|
||||
</Text>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
<Image
|
||||
source={gitlab}
|
||||
style={{height: 18, marginRight: 5, width: 18}}
|
||||
/>
|
||||
<Text
|
||||
style={[GlobalStyles.signupButtonText, {color: 'white'}]}
|
||||
>
|
||||
{'GitLab'}
|
||||
</Text>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue