Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3311386
D13557.id44751.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
D13557.id44751.diff
View Options
diff --git a/lib/selectors/thread-selectors.js b/lib/selectors/thread-selectors.js
--- a/lib/selectors/thread-selectors.js
+++ b/lib/selectors/thread-selectors.js
@@ -33,7 +33,6 @@
roleIsAdminRole,
threadIsPending,
getPendingThreadID,
- pendingThreadType,
} from '../shared/thread-utils.js';
import type { ClientAvatar, ClientEmojiAvatar } from '../types/avatar-types';
import type { EntryInfo } from '../types/entry-types.js';
@@ -49,7 +48,10 @@
threadTypeIsThick,
threadTypeIsCommunityRoot,
type ThreadType,
+ threadTypes,
threadTypeIsSidebar,
+ threadTypeIsPrivate,
+ threadTypeIsPersonal,
} from '../types/thread-types-enum.js';
import type {
MixedRawThreadInfos,
@@ -459,17 +461,38 @@
) {
continue;
}
+
const actualMemberIDs = rawThreadInfo.members
.filter(member => member.role)
.map(member => member.id);
+
// In this function we're generating possible pending thread IDs that
// could become `rawThreadInfos`. It is possible that a thick pending
// thread becomes a thin thread, so we're including it twice in a map -
// for each possible pending thread ID.
- const possiblePendingThreadTypes = [
- pendingThreadType(actualMemberIDs.length - 1, 'thin'),
- pendingThreadType(actualMemberIDs.length - 1, 'thick'),
- ];
+ let possiblePendingThreadTypes;
+ if (threadTypeIsPersonal(rawThreadInfo.type)) {
+ possiblePendingThreadTypes = [
+ threadTypes.PERSONAL,
+ threadTypes.GENESIS_PERSONAL,
+ ];
+ } else if (threadTypeIsPrivate(rawThreadInfo.type)) {
+ possiblePendingThreadTypes = [
+ threadTypes.PRIVATE,
+ threadTypes.GENESIS_PRIVATE,
+ ];
+ } else if (threadTypeIsSidebar(rawThreadInfo.type)) {
+ possiblePendingThreadTypes = [
+ threadTypes.THICK_SIDEBAR,
+ threadTypes.SIDEBAR,
+ ];
+ } else {
+ possiblePendingThreadTypes = [
+ threadTypes.LOCAL,
+ threadTypes.COMMUNITY_SECRET_SUBTHREAD,
+ ];
+ }
+
for (const type of possiblePendingThreadTypes) {
const pendingThreadID = getPendingThreadID(
type,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 8:09 AM (19 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543795
Default Alt Text
D13557.id44751.diff (2 KB)
Attached To
Mode
D13557: [lib] Match thread types in pendingToRealizedThreadIDsSelector
Attached
Detach File
Event Timeline
Log In to Comment