Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32532028
D12288.1767152798.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D12288.1767152798.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
@@ -920,20 +920,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,
@@ -1650,7 +1636,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<Props> {
@@ -343,12 +344,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 +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}
/>
);
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 31, 3:46 AM (15 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5871859
Default Alt Text
D12288.1767152798.diff (2 KB)
Attached To
Mode
D12288: [lib] Consume `useThreadFrozenDueToViewerBlock` in `web/ChatInputBar`
Attached
Detach File
Event Timeline
Log In to Comment