From 5c1df65a0cd753a8a9be187e192611556f401d6e Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 24 May 2021 13:09:54 +0300 Subject: [PATCH] Fix Create Chat: Can't create a channel without subscribers (#1115) --- src/components/left/newChat/NewChatStep1.tsx | 6 +++--- src/components/left/newChat/NewChatStep2.tsx | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/left/newChat/NewChatStep1.tsx b/src/components/left/newChat/NewChatStep1.tsx index 42c6ade6..3145110e 100644 --- a/src/components/left/newChat/NewChatStep1.tsx +++ b/src/components/left/newChat/NewChatStep1.tsx @@ -101,11 +101,11 @@ const NewChatStep1: FC = ({ ]); const handleNextStep = useCallback(() => { - if (selectedMemberIds.length) { + if (selectedMemberIds.length || isChannel) { setGlobalSearchQuery({ query: '' }); onNextStep(); } - }, [selectedMemberIds, setGlobalSearchQuery, onNextStep]); + }, [selectedMemberIds.length, isChannel, setGlobalSearchQuery, onNextStep]); const lang = useLang(); @@ -136,7 +136,7 @@ const NewChatStep1: FC = ({ /> diff --git a/src/components/left/newChat/NewChatStep2.tsx b/src/components/left/newChat/NewChatStep2.tsx index 42002979..3fa1b487 100644 --- a/src/components/left/newChat/NewChatStep2.tsx +++ b/src/components/left/newChat/NewChatStep2.tsx @@ -154,15 +154,19 @@ const NewChatStep2: FC = ({

{renderedError}

)} -

{lang('GroupInfo.ParticipantCount', memberIds.length, 'i')}

+ {memberIds.length > 0 && ( + <> +

{lang('GroupInfo.ParticipantCount', memberIds.length, 'i')}

-
- {memberIds.map((id) => ( - - - - ))} -
+
+ {memberIds.map((id) => ( + + + + ))} +
+ + )}