From 8268beeb67e3a47f7319a4534d0d0ee07771bdd2 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Fri, 8 Apr 2022 19:53:48 -0300 Subject: [PATCH] [FIX] Create a discussion from NewMessageView (#4003) * [FIX] Create a discussion from NewMessageView * fix the itemData.value to any * minor tweak --- app/containers/UIKit/MultiSelect/Items.tsx | 2 +- app/containers/UIKit/MultiSelect/index.tsx | 2 +- app/views/CreateDiscussionView/SelectChannel.tsx | 2 +- app/views/CreateDiscussionView/index.tsx | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/containers/UIKit/MultiSelect/Items.tsx b/app/containers/UIKit/MultiSelect/Items.tsx index 4e9265d2..311894db 100644 --- a/app/containers/UIKit/MultiSelect/Items.tsx +++ b/app/containers/UIKit/MultiSelect/Items.tsx @@ -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 ( ({ - value: channel.name || channel.fname, + value: channel, text: { text: RocketChat.getRoomTitle(channel) }, imageUrl: getAvatar(channel) }))} diff --git a/app/views/CreateDiscussionView/index.tsx b/app/views/CreateDiscussionView/index.tsx index 67e467b2..2810daaa 100644 --- a/app/views/CreateDiscussionView/index.tsx +++ b/app/views/CreateDiscussionView/index.tsx @@ -137,8 +137,6 @@ class CreateChannelView extends React.Component { 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]; }