[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:
parent
ec952b058a
commit
8268beeb67
|
@ -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}`}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
}))}
|
}))}
|
||||||
|
|
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue