diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -944,20 +944,6 @@ return innerThreadFrozenDueToBlock(threadInfo, viewerID, userInfos, false); } -function threadFrozenDueToViewerBlock( - threadInfo: ThreadInfo, - communityThreadInfo: ?ThreadInfo, - viewerID: ?string, - userInfos: UserInfos, -): boolean { - const options: ThreadIsWithBlockedUserOnlyOptions = { - checkOnlyViewerBlock: true, - skipMemberAdminRoleCheck: false, - }; - - return threadIsWithBlockedUserOnly(threadInfo, viewerID, userInfos, options); -} - function useThreadFrozenDueToViewerBlock( threadInfo: ThreadInfo, communityThreadInfo: ?ThreadInfo, @@ -1686,7 +1672,6 @@ pendingThreadType, filterOutDisabledPermissions, threadFrozenDueToBlock, - threadFrozenDueToViewerBlock, useThreadFrozenDueToViewerBlock, rawThreadInfoFromServerThreadInfo, threadUIName, diff --git a/web/chat/chat-input-bar.react.js b/web/chat/chat-input-bar.react.js --- a/web/chat/chat-input-bar.react.js +++ b/web/chat/chat-input-bar.react.js @@ -28,7 +28,7 @@ import { checkIfDefaultMembersAreVoiced, threadActualMembers, - threadFrozenDueToViewerBlock, + useThreadFrozenDueToViewerBlock, useThreadHasPermission, viewerIsMember, } from 'lib/shared/thread-utils.js'; @@ -85,6 +85,7 @@ +communityThreadInfo: ?ThreadInfo, +currentUserIsVoiced: boolean, +currentUserCanJoinThread: boolean, + +threadFrozen: boolean, }; class ChatInputBar extends React.PureComponent { @@ -343,12 +344,7 @@ ); } else if ( - threadFrozenDueToViewerBlock( - this.props.threadInfo, - this.props.communityThreadInfo, - this.props.viewerID, - this.props.userInfos, - ) && + this.props.threadFrozen && threadActualMembers(this.props.threadInfo.members).length === 2 ) { content = ( @@ -593,6 +589,13 @@ community ? threadInfoSelector(state)[community] : null, ); + const threadFrozen = useThreadFrozenDueToViewerBlock( + props.threadInfo, + communityThreadInfo, + viewerID, + userInfos, + ); + const currentUserIsVoiced = useThreadHasPermission( props.threadInfo, threadPermissions.VOICED, @@ -685,6 +688,7 @@ communityThreadInfo={communityThreadInfo} currentUserIsVoiced={currentUserIsVoiced} currentUserCanJoinThread={currentUserCanJoinThread} + threadFrozen={threadFrozen} /> ); });