Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3150219
D12288.id41354.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D12288.id41354.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 5, 10:40 PM (18 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2426666
Default Alt Text
D12288.id41354.diff (3 KB)
Attached To
Mode
D12288: [lib] Consume `useThreadFrozenDueToViewerBlock` in `web/ChatInputBar`
Attached
Detach File
Event Timeline
Log In to Comment