Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3311490
D13548.id44729.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13548.id44729.diff
View Options
diff --git a/lib/shared/thread-actions-utils.js b/lib/shared/thread-actions-utils.js
--- a/lib/shared/thread-actions-utils.js
+++ b/lib/shared/thread-actions-utils.js
@@ -126,47 +126,41 @@
parentThreadID: threadInfo.parentThreadID,
name: threadInfo.name,
});
- } else {
- invariant(
- otherMemberIDs.length > 0,
- 'otherMemberIDs should not be empty for threads',
+ } else if (threadTypeIsThick(threadInfo.type)) {
+ const type = assertThickThreadType(
+ pendingThreadType(otherMemberIDs.length, 'thick'),
);
- if (threadTypeIsThick(threadInfo.type)) {
- const type = assertThickThreadType(
- pendingThreadType(otherMemberIDs.length, 'thick'),
- );
- invariant(
- type !== 16,
- // Flow does not recognize that threadTypes.THICK_SIDEBAR is 16
- 'pendingThreadType should not return THICK_SIDEBAR',
- );
- newThreadID = await createNewThickThread({
- type,
- initialMemberIDs: otherMemberIDs,
- color: threadInfo.color,
- });
- newThreadType = type;
- } else {
- const type = assertThinThreadType(
- pendingThreadType(otherMemberIDs.length, 'thin'),
- );
+ invariant(
+ type !== 16,
+ // Flow does not recognize that threadTypes.THICK_SIDEBAR is 16
+ 'pendingThreadType should not return THICK_SIDEBAR',
+ );
+ newThreadID = await createNewThickThread({
+ type,
+ initialMemberIDs: otherMemberIDs,
+ color: threadInfo.color,
+ });
+ newThreadType = type;
+ } else {
+ const type = assertThinThreadType(
+ pendingThreadType(otherMemberIDs.length, 'thin'),
+ );
- invariant(
- type !== 5, // Flow does not recognize that threadTypes.SIDEBAR is 5
- 'pendingThreadType should not return SIDEBAR',
- );
- resultPromise = createNewThinThread({
- type,
- initialMemberIDs: otherMemberIDs,
- color: threadInfo.color,
- calendarQuery,
- });
- void dispatchActionPromise(newThreadActionTypes, resultPromise);
- const result = await resultPromise;
- newThreadID = result.newThreadID;
- newThreadType = type;
- }
+ invariant(
+ type !== 5, // Flow does not recognize that threadTypes.SIDEBAR is 5
+ 'pendingThreadType should not return SIDEBAR',
+ );
+ resultPromise = createNewThinThread({
+ type,
+ initialMemberIDs: otherMemberIDs,
+ color: threadInfo.color,
+ calendarQuery,
+ });
+ void dispatchActionPromise(newThreadActionTypes, resultPromise);
+ const result = await resultPromise;
+ newThreadID = result.newThreadID;
+ newThreadType = type;
}
return {
threadID: newThreadID,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 9:02 AM (18 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543874
Default Alt Text
D13548.id44729.diff (2 KB)
Attached To
Mode
D13548: [lib] Allow calling createRealThreadFromPendingThread for PRIVATE thread
Attached
Detach File
Event Timeline
Log In to Comment