Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3752425
D11760.id39440.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
D11760.id39440.diff
View Options
diff --git a/web/chat/chat-message-list.react.js b/web/chat/chat-message-list.react.js
--- a/web/chat/chat-message-list.react.js
+++ b/web/chat/chat-message-list.react.js
@@ -24,7 +24,10 @@
useMessageListData,
} from 'lib/selectors/chat-selectors.js';
import { messageKey } from 'lib/shared/message-utils.js';
-import { threadIsPending } from 'lib/shared/thread-utils.js';
+import {
+ threadIsPending,
+ threadOtherMembers,
+} from 'lib/shared/thread-utils.js';
import type { FetchMessageInfosPayload } from 'lib/types/message-types.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
@@ -76,6 +79,7 @@
+isEditState: boolean,
+addScrollToMessageListener: ScrollToMessageCallback => mixed,
+removeScrollToMessageListener: ScrollToMessageCallback => mixed,
+ +viewerID: ?string,
};
type Snapshot = {
+scrollTop: number,
@@ -315,7 +319,22 @@
let relationshipPrompt = null;
if (threadInfo.type === threadTypes.PERSONAL) {
- relationshipPrompt = <RelationshipPrompt threadInfo={threadInfo} />;
+ const otherMember = threadOtherMembers(
+ threadInfo.members,
+ this.props.viewerID,
+ )[0];
+
+ const pendingPersonalThreadUserInfo = {
+ id: otherMember.id,
+ username: otherMember.username,
+ };
+
+ relationshipPrompt = (
+ <RelationshipPrompt
+ threadInfo={threadInfo}
+ pendingPersonalThreadUserInfo={pendingPersonalThreadUserInfo}
+ />
+ );
}
const messageContainerStyle = classNames({
@@ -462,6 +481,8 @@
} = useEditModalContext();
const isEditState = editState !== null;
+ const viewerID = useSelector(state => state.currentUserInfo?.id);
+
return (
<MessageListContext.Provider value={messageListContext}>
<ChatMessageList
@@ -478,6 +499,7 @@
isEditState={isEditState}
addScrollToMessageListener={addScrollToMessageListener}
removeScrollToMessageListener={removeScrollToMessageListener}
+ viewerID={viewerID}
/>
</MessageListContext.Provider>
);
diff --git a/web/chat/relationship-prompt/relationship-prompt.js b/web/chat/relationship-prompt/relationship-prompt.js
--- a/web/chat/relationship-prompt/relationship-prompt.js
+++ b/web/chat/relationship-prompt/relationship-prompt.js
@@ -11,19 +11,26 @@
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
+import type { UserInfo } from 'lib/types/user-types.js';
import RelationshipPromptButtonContainer from './relationship-prompt-button-container.js';
import RelationshipPromptButton from './relationship-prompt-button.js';
import { buttonThemes } from '../../components/button.react.js';
-type Props = { +threadInfo: ThreadInfo };
-
+type Props = {
+ +pendingPersonalThreadUserInfo: ?UserInfo,
+ +threadInfo: ThreadInfo,
+};
function RelationshipPrompt(props: Props) {
const { threadInfo } = props;
const {
otherUserInfo,
callbacks: { blockUser, unblockUser, friendUser, unfriendUser },
- } = useRelationshipPrompt(threadInfo);
+ } = useRelationshipPrompt(
+ threadInfo,
+ undefined,
+ props.pendingPersonalThreadUserInfo,
+ );
if (!otherUserInfo?.username) {
return null;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 12:39 AM (15 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2857549
Default Alt Text
D11760.id39440.diff (3 KB)
Attached To
Mode
D11760: [web] Fix missing relationship buttons
Attached
Detach File
Event Timeline
Log In to Comment