Show TeamChannelsView only if joined the team

This commit is contained in:
Gerzon Z 2021-04-26 10:21:04 -04:00
parent 16fd57527a
commit 1ff77118f5
2 changed files with 7 additions and 5 deletions

View File

@ -18,7 +18,8 @@ class RightButtonsContainer extends Component {
teamId: PropTypes.bool,
navigation: PropTypes.object,
isMasterDetail: PropTypes.bool,
toggleFollowThread: PropTypes.func
toggleFollowThread: PropTypes.func,
joined: PropTypes.bool
};
constructor(props) {
@ -163,7 +164,7 @@ class RightButtonsContainer extends Component {
isFollowingThread, tunread, tunreadUser, tunreadGroup
} = this.state;
const {
t, tmid, threadsEnabled, teamId
t, tmid, threadsEnabled, teamId, joined
} = this.props;
if (t === 'l') {
return null;
@ -181,7 +182,7 @@ class RightButtonsContainer extends Component {
}
return (
<HeaderButton.Container>
{teamId ? (
{teamId && joined ? (
<HeaderButton.Item
iconName='channel-public'
onPress={this.goTeamChannels}

View File

@ -301,7 +301,7 @@ class RoomView extends React.Component {
setHeader = () => {
const {
room, unreadsCount, roomUserId
room, unreadsCount, roomUserId, joined
} = this.state;
const {
navigation, isMasterDetail, theme, baseUrl, user, insets, route
@ -331,7 +331,7 @@ class RoomView extends React.Component {
let numIconsRight = 2;
if (tmid) {
numIconsRight = 1;
} else if (teamId) {
} else if (teamId && joined) {
numIconsRight = 3;
}
const headerTitlePosition = getHeaderTitlePosition({ insets, numIconsRight });
@ -380,6 +380,7 @@ class RoomView extends React.Component {
rid={rid}
tmid={tmid}
teamId={teamId}
joined={joined}
t={t}
navigation={navigation}
toggleFollowThread={this.toggleFollowThread}