Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3516168
D13259.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13259.diff
View Options
diff --git a/lib/hooks/thread-hooks.js b/lib/hooks/thread-hooks.js
--- a/lib/hooks/thread-hooks.js
+++ b/lib/hooks/thread-hooks.js
@@ -67,12 +67,15 @@
state => state.currentUserInfo && state.currentUserInfo.id,
);
+ const threadInfos = useSelector(state => state.threadStore.threadInfos);
+
return React.useCallback(
async (input: NewThickThreadRequest) => {
invariant(viewerID, 'viewerID must be defined');
const threadID = input.id ?? uuid.v4();
let op;
+ let recipientIDs;
if (input.type === threadTypes.THICK_SIDEBAR) {
const { parentThreadID, sourceMessageID, initialMemberIDs } = input;
invariant(
@@ -92,6 +95,9 @@
type: 'create_sidebar',
};
op = sidebarOP;
+ recipientIDs = threadInfos[parentThreadID].members.map(
+ member => member.id,
+ );
} else {
const { type, initialMemberIDs } = input;
@@ -106,20 +112,20 @@
type: 'create_thread',
};
op = threadOP;
+ recipientIDs = [...(input.initialMemberIDs ?? []), viewerID];
}
- const userIDs = [...(input.initialMemberIDs ?? []), viewerID];
const opSpecification: OutboundDMOperationSpecification = {
type: dmOperationSpecificationTypes.OUTBOUND,
op,
recipients: {
type: 'some_users',
- userIDs,
+ userIDs: recipientIDs,
},
};
await processAndSendDMOperation(opSpecification);
return threadID;
},
- [processAndSendDMOperation, viewerID],
+ [processAndSendDMOperation, threadInfos, viewerID],
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 12:36 PM (19 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694707
Default Alt Text
D13259.diff (1 KB)
Attached To
Mode
D13259: [lib] Fix sendnig create_sidebar to peers
Attached
Detach File
Event Timeline
Log In to Comment