[FIX] Create a discussion from NewMessageView (#4003)

* [FIX] Create a discussion from NewMessageView

* fix the itemData.value to any

* minor tweak
This commit is contained in:
Reinaldo Neto 2022-04-08 19:53:48 -03:00 committed by GitHub
parent ec952b058a
commit 8268beeb67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 5 deletions

View File

@ -28,7 +28,7 @@ const keyExtractor = (item: IItemData) => item.value.toString();
// RectButton doesn't work on modal (Android)
const Item = ({ item, selected, onSelect, theme }: IItem) => {
const itemName = item.value || item.text.text.toLowerCase();
const itemName = item.value?.name || item.text.text.toLowerCase();
return (
<Touchable
testID={`multi-select-item-${itemName}`}

View File

@ -26,7 +26,7 @@ import Input from './Input';
import styles from './styles';
export interface IItemData {
value: string;
value: any;
text: { text: string };
imageUrl?: string;
}

View File

@ -54,7 +54,7 @@ const SelectChannel = ({
value={initial && [initial]}
disabled={!!initial}
options={channels.map(channel => ({
value: channel.name || channel.fname,
value: channel,
text: { text: RocketChat.getRoomTitle(channel) },
imageUrl: getAvatar(channel)
}))}

View File

@ -137,8 +137,6 @@ class CreateChannelView extends React.Component<ICreateChannelViewProps, any> {
get isEncryptionEnabled() {
const { channel } = this.state;
const { encryptionEnabled } = this.props;
// TODO: remove this ts-ignore when migrate the file: app/lib/encryption/constants.js
// @ts-ignore
return encryptionEnabled && E2E_ROOM_TYPES[channel?.t];
}