diff --git a/package/src/components/Channel/Channel.tsx b/package/src/components/Channel/Channel.tsx index 4033eddd95..caa5f13d1f 100644 --- a/package/src/components/Channel/Channel.tsx +++ b/package/src/components/Channel/Channel.tsx @@ -560,7 +560,6 @@ const ChannelWithContext = < handleRetry, handleThreadReply, hasCameraPicker = isImagePickerAvailable(), - hasCommands = true, hasCreatePoll, // If pickDocument isn't available, default to hiding the file picker hasFilePicker = isDocumentPickerAvailable(), @@ -1828,7 +1827,7 @@ const ChannelWithContext = < FileUploadPreview, handleAttachButtonPress, hasCameraPicker, - hasCommands, + hasCommands: (getChannelConfigSafely()?.commands ?? []).length > 0, hasFilePicker, hasImagePicker, ImageUploadPreview, diff --git a/package/src/components/Channel/__tests__/Channel.test.js b/package/src/components/Channel/__tests__/Channel.test.js index 7f263ed528..366d94d8ee 100644 --- a/package/src/components/Channel/__tests__/Channel.test.js +++ b/package/src/components/Channel/__tests__/Channel.test.js @@ -77,6 +77,8 @@ describe('Channel', () => { useMockedApis(chatClient, [getOrCreateChannelApi(mockedChannel)]); channel = chatClient.channel('messaging', mockedChannel.id); channel.cid = mockedChannel.channel.cid; + const getConfigSpy = jest.fn(); + channel.getConfig = getConfigSpy; }); afterEach(() => {