Skip to content

Commit

Permalink
remove polls when we are in a thread
Browse files Browse the repository at this point in the history
Changelog: fixed
  • Loading branch information
Cyril Gromoff committed Sep 3, 2024
1 parent b0a814c commit 0d401e5
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,16 @@ class AdvancedCreateComment extends React.PureComponent<Props, State> {
);
});

const additionalControls = [];
if (!this.props.isThreadView) {
additionalControls.push(
<Poll
rootId={this.props.rootId}
key='poll'
disabled={this.props.shouldShowPreview}
/>);
}
additionalControls.push(...(pluginItems || []).filter(Boolean));
return (
<form onSubmit={this.handleSubmit}>
{
Expand Down Expand Up @@ -1174,14 +1184,7 @@ class AdvancedCreateComment extends React.PureComponent<Props, State> {
setDraftAsPostType={this.setDraftAsPostType}
isSchedulable={true}
handleSchedulePost={this.handleSchedulePost}
additionalControls={[
<Poll
rootId={this.props.rootId}
key='poll'
disabled={this.props.shouldShowPreview}
/>,
...(pluginItems || []),
].filter(Boolean)}
additionalControls={additionalControls}
codeBlockOnCtrlEnter={this.props.codeBlockOnCtrlEnter}
ctrlSend={this.props.ctrlSend}
loadNextMessage={this.loadNextMessage}
Expand Down

0 comments on commit 0d401e5

Please sign in to comment.