Skip to content

Commit f191732

Browse files
committed
fix: respect commands config from dashboard
1 parent 1cc008c commit f191732

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package/src/components/Channel/Channel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ const ChannelWithContext = <
560560
handleRetry,
561561
handleThreadReply,
562562
hasCameraPicker = isImagePickerAvailable(),
563-
hasCommands = true,
563+
hasCommands = (channel.getConfig()?.commands ?? []).length > 0,
564564
hasCreatePoll,
565565
// If pickDocument isn't available, default to hiding the file picker
566566
hasFilePicker = isDocumentPickerAvailable(),

package/src/components/Channel/__tests__/Channel.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ describe('Channel', () => {
7777
useMockedApis(chatClient, [getOrCreateChannelApi(mockedChannel)]);
7878
channel = chatClient.channel('messaging', mockedChannel.id);
7979
channel.cid = mockedChannel.channel.cid;
80+
const getConfigSpy = jest.fn();
81+
channel.getConfig = getConfigSpy;
8082
});
8183

8284
afterEach(() => {

0 commit comments

Comments
 (0)