Page MenuHomePhabricator

D13259.id44084.diff
No OneTemporary

D13259.id44084.diff

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

Mime Type
text/plain
Expires
Fri, Sep 20, 10:42 AM (19 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2141588
Default Alt Text
D13259.id44084.diff (1 KB)

Event Timeline