[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) // RectButton doesn't work on modal (Android)
const Item = ({ item, selected, onSelect, theme }: IItem) => { 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 ( return (
<Touchable <Touchable
testID={`multi-select-item-${itemName}`} testID={`multi-select-item-${itemName}`}

View File

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

View File

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

View File

@ -137,8 +137,6 @@ class CreateChannelView extends React.Component<ICreateChannelViewProps, any> {
get isEncryptionEnabled() { get isEncryptionEnabled() {
const { channel } = this.state; const { channel } = this.state;
const { encryptionEnabled } = this.props; 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]; return encryptionEnabled && E2E_ROOM_TYPES[channel?.t];
} }