Page MenuHomePhabricator

D12288.id41355.diff
No OneTemporary

D12288.id41355.diff

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';
@@ -41,7 +41,6 @@
type ClientThreadJoinRequest,
type ThreadJoinPayload,
} from 'lib/types/thread-types.js';
-import { type UserInfos } from 'lib/types/user-types.js';
import {
type DispatchActionPromise,
useDispatchActionPromise,
@@ -76,15 +75,14 @@
+threadCreationInProgress: boolean,
+calendarQuery: () => CalendarQuery,
+isThreadActive: boolean,
- +userInfos: UserInfos,
+dispatchActionPromise: DispatchActionPromise,
+joinThread: (request: ClientThreadJoinRequest) => Promise<ThreadJoinPayload>,
+typeaheadMatchedStrings: ?TypeaheadMatchedStrings,
+suggestions: $ReadOnlyArray<MentionTypeaheadSuggestionItem>,
+parentThreadInfo: ?ThreadInfo,
- +communityThreadInfo: ?ThreadInfo,
+currentUserIsVoiced: boolean,
+currentUserCanJoinThread: boolean,
+ +threadFrozen: boolean,
};
class ChatInputBar extends React.PureComponent<Props> {
@@ -343,12 +341,7 @@
</div>
);
} 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 +586,13 @@
community ? threadInfoSelector(state)[community] : null,
);
+ const threadFrozen = useThreadFrozenDueToViewerBlock(
+ props.threadInfo,
+ communityThreadInfo,
+ viewerID,
+ userInfos,
+ );
+
const currentUserIsVoiced = useThreadHasPermission(
props.threadInfo,
threadPermissions.VOICED,
@@ -676,15 +676,14 @@
threadCreationInProgress={threadCreationInProgress}
calendarQuery={calendarQuery}
isThreadActive={isThreadActive}
- userInfos={userInfos}
dispatchActionPromise={dispatchActionPromise}
joinThread={callJoinThread}
typeaheadMatchedStrings={typeaheadMatchedStrings}
suggestions={suggestions}
parentThreadInfo={parentThreadInfo}
- communityThreadInfo={communityThreadInfo}
currentUserIsVoiced={currentUserIsVoiced}
currentUserCanJoinThread={currentUserCanJoinThread}
+ threadFrozen={threadFrozen}
/>
);
});

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 12:44 PM (21 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572356
Default Alt Text
D12288.id41355.diff (3 KB)

Event Timeline