diff --git a/app/stacks/MasterDetailStack/types.ts b/app/stacks/MasterDetailStack/types.ts index f06cfd5b9..181a35d35 100644 --- a/app/stacks/MasterDetailStack/types.ts +++ b/app/stacks/MasterDetailStack/types.ts @@ -58,6 +58,12 @@ export type ModalStackParamList = { onSearch?: Function; isRadio?: boolean; }; + ChangeAvatarView: { + fromUser?: boolean; + titleHeader?: string; + room?: ISubscription; + t?: SubscriptionType; + }; RoomInfoEditView: { rid: string; }; diff --git a/app/views/ChangeAvatarView/index.tsx b/app/views/ChangeAvatarView/index.tsx index 29aa8a987..03570e5f9 100644 --- a/app/views/ChangeAvatarView/index.tsx +++ b/app/views/ChangeAvatarView/index.tsx @@ -4,6 +4,7 @@ import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'; import { StackNavigationProp } from '@react-navigation/stack'; import ImagePicker, { Image } from 'react-native-image-crop-picker'; +import { compareServerVersion } from '../../lib/methods/helpers'; import KeyboardView from '../../containers/KeyboardView'; import sharedStyles from '../Styles'; import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps'; @@ -27,13 +28,14 @@ import log from '../../lib/methods/helpers/log'; const ChangeAvatarView = () => { const [avatar, setAvatarState] = useState(); - + const [textAvatar, setTextAvatar] = useState(''); const [saving, setSaving] = useState(false); const { colors } = useTheme(); - const { user } = useAppSelector(state => ({ + const { user, serverVersion } = useAppSelector(state => ({ user: getUserSelector(state), - isMasterDetail: state.app.isMasterDetail + isMasterDetail: state.app.isMasterDetail, + serverVersion: state.server.version })); const avatarUrl = useRef(''); @@ -182,7 +184,7 @@ const ChangeAvatarView = () => { onPress={pickImage} testID='change-avatar-view-logout-other-locations' /> - {!fromUser ? ( + {!fromUser && serverVersion && compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '3.6.0') ? (