diff --git a/web/chat/composed-message.react.js b/web/chat/composed-message.react.js --- a/web/chat/composed-message.react.js +++ b/web/chat/composed-message.react.js @@ -140,7 +140,6 @@ mouseOverMessagePosition={this.props.mouseOverMessagePosition} canReply={this.props.canReply} inputState={this.props.inputState} - sidebarExistsOrCanBeCreated={this.props.sidebarExistsOrCanBeCreated} /> ); } diff --git a/web/chat/message-action-buttons.js b/web/chat/message-action-buttons.js --- a/web/chat/message-action-buttons.js +++ b/web/chat/message-action-buttons.js @@ -5,6 +5,7 @@ import * as React from 'react'; import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors'; +import { useSidebarExistsOrCanBeCreated } from 'lib/shared/thread-utils'; import type { ThreadInfo } from 'lib/types/thread-types'; import type { InputState } from '../input/input-state.js'; @@ -44,7 +45,6 @@ +mouseOverMessagePosition?: OnMessagePositionWithContainerInfo, +canReply?: boolean, +inputState?: ?InputState, - +sidebarExistsOrCanBeCreated?: boolean, }; function MessageActionButtons(props: MessageActionButtonsProps): React.Node { const { @@ -56,7 +56,6 @@ mouseOverMessagePosition, canReply, inputState, - sidebarExistsOrCanBeCreated, } = props; const [tooltipVisible, setTooltipVisible] = React.useState(false); @@ -155,6 +154,11 @@ ); } + const sidebarExistsOrCanBeCreated = useSidebarExistsOrCanBeCreated( + threadInfo, + item, + ); + let sidebarButton; if (sidebarExistsOrCanBeCreated) { sidebarButton = (