Skip to content

Commit 3788509

Browse files
committed
fix: check for poll creation from channel settings too
1 parent ab1a4a7 commit 3788509

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

package/src/components/Channel/Channel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,6 +2353,8 @@ const ChannelWithContext = <
23532353
setLoadingMoreRecent,
23542354
});
23552355

2356+
const pollCreationEnabled = channel.getConfig()?.polls;
2357+
23562358
const messagesContext = useCreateMessagesContext({
23572359
additionalTouchableProps,
23582360
Attachment,
@@ -2391,7 +2393,8 @@ const ChannelWithContext = <
23912393
handleReaction,
23922394
handleRetry,
23932395
handleThreadReply,
2394-
hasCreatePoll: hasCreatePoll === undefined ? true : hasCreatePoll,
2396+
hasCreatePoll:
2397+
hasCreatePoll === undefined ? pollCreationEnabled : hasCreatePoll && pollCreationEnabled,
23952398
ImageLoadingFailedIndicator,
23962399
ImageLoadingIndicator,
23972400
initialScrollToFirstUnreadMessage: !messageId && initialScrollToFirstUnreadMessage, // when messageId is set, we scroll to the messageId instead of first unread

0 commit comments

Comments
 (0)