From 9c41c8d557ff6b8651ac8fa91d2fc6129fad66b8 Mon Sep 17 00:00:00 2001 From: Satyam <100528412+KlausMikhaelson@users.noreply.github.com> Date: Wed, 20 Dec 2023 00:54:58 -0600 Subject: [PATCH] fix: fixed create group btn not disabling and added minimum member requirement (#941) --- .../src/lib/components/chat/ChatProfile/AddWalletContent.tsx | 2 +- .../uiweb/src/lib/components/chat/CreateGroup/AddWallets.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx b/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx index 536548606..0cd4f18ae 100644 --- a/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatProfile/AddWalletContent.tsx @@ -185,12 +185,12 @@ export const AddWalletContent = ({
{ - // console.log(groupMembers); onSubmit() }} isLoading={isLoading} memberListCount={memberList?.length > 0} theme={theme} + disabled={isLoading || groupMembers.length === 0} > {!isLoading && groupMembers ? (submitButtonTitle ? submitButtonTitle : 'Add To Group'): ''} {isLoading && } diff --git a/packages/uiweb/src/lib/components/chat/CreateGroup/AddWallets.tsx b/packages/uiweb/src/lib/components/chat/CreateGroup/AddWallets.tsx index db2a4f965..c770bfa9e 100644 --- a/packages/uiweb/src/lib/components/chat/CreateGroup/AddWallets.tsx +++ b/packages/uiweb/src/lib/components/chat/CreateGroup/AddWallets.tsx @@ -23,7 +23,7 @@ interface AddWalletsInCreateGroupProps { } const AddWalletsInCreateGroup = ({ handlePrevious, onClose,groupInputDetails, groupEncryptionType, checked, criteriaStateManager, groupMembers, setGroupMembers }: AddWalletsInCreateGroupProps) => { - const { createGatedGroup } = useCreateGatedGroup(); + const { createGatedGroup, loading } = useCreateGatedGroup(); const groupInfoToast = useToast(); const getEncryptionType = () => { if (groupEncryptionType === 'encrypted') { @@ -85,7 +85,7 @@ const AddWalletsInCreateGroup = ({ handlePrevious, onClose,groupInputDetails, gr memberList={groupMembers} handleMemberList={setGroupMembers} groupMembers={groupInputDetails.groupMembers} - isLoading={false} + isLoading={loading} modalHeader="Add Wallets" />