From 524e1630912beae080c170d3da487140671442f0 Mon Sep 17 00:00:00 2001 From: Prateek Jain Date: Wed, 4 Mar 2020 02:55:23 +0530 Subject: [PATCH] [FIX] Remove all invited users when create a channel (#1814) Co-authored-by: Diego Mello --- app/presentation/UserItem.js | 4 +++- app/views/CreateChannelView.js | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/presentation/UserItem.js b/app/presentation/UserItem.js index 7ac25739f..f5caa5c2c 100644 --- a/app/presentation/UserItem.js +++ b/app/presentation/UserItem.js @@ -44,7 +44,9 @@ const UserItem = ({ }) => { const longPress = ({ nativeEvent }) => { if (nativeEvent.state === State.ACTIVE) { - onLongPress(); + if (onLongPress) { + onLongPress(); + } } }; diff --git a/app/views/CreateChannelView.js b/app/views/CreateChannelView.js index 785647353..c9c767d48 100644 --- a/app/views/CreateChannelView.js +++ b/app/views/CreateChannelView.js @@ -208,10 +208,7 @@ class CreateChannelView extends React.Component { } removeUser = (user) => { - const { users, removeUser } = this.props; - if (users.length === 1) { - return; - } + const { removeUser } = this.props; removeUser(user); } @@ -285,6 +282,7 @@ class CreateChannelView extends React.Component { username={item.name} onPress={() => this.removeUser(item)} testID={`create-channel-view-item-${ item.name }`} + icon='check' baseUrl={baseUrl} user={user} theme={theme}