Disabled option for guest users

This commit is contained in:
harshil Sharma 2023-11-02 12:00:19 +05:30
parent bf2fd6594d
commit e171c82703
2 changed files with 5 additions and 1 deletions

View file

@ -23,6 +23,7 @@ import Options from './options';
import Title from './title';
import type {AvailableScreens} from '@typings/screens/navigation';
import type { UserModel } from '@app/database/models/server';
type Props = {
channelId: string;
@ -33,6 +34,7 @@ type Props = {
isCallsEnabledInChannel: boolean;
canManageMembers: boolean;
canManageSettings: boolean;
currentUser: UserModel;
}
const edges: Edge[] = ['bottom', 'left', 'right'];
@ -61,6 +63,7 @@ const ChannelInfo = ({
isCallsEnabledInChannel,
canManageMembers,
canManageSettings,
currentUser,
}: Props) => {
const theme = useTheme();
const serverUrl = useServerUrl();
@ -112,7 +115,7 @@ const ChannelInfo = ({
/>
<View style={styles.separator}/>
{/* LOL hide this option for guest users */}
{type === General.GM_CHANNEL &&
{type === General.GM_CHANNEL && !currentUser.isGuest &&
<>
<ConvertToChannelLabel
channelId={channelId}

View file

@ -118,6 +118,7 @@ const enhanced = withObservables([], ({serverUrl, database}: Props) => {
isCallsEnabledInChannel,
canManageMembers,
canManageSettings,
currentUser,
};
});