diff --git a/lib/shared/sidebar-utils.js b/lib/shared/sidebar-utils.js --- a/lib/shared/sidebar-utils.js +++ b/lib/shared/sidebar-utils.js @@ -20,7 +20,7 @@ } from '../types/message-types.js'; import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from '../types/thread-permission-types.js'; -import { threadTypes } from '../types/thread-types-enum.js'; +import { threadTypes, threadTypeIsThick } from '../types/thread-types-enum.js'; import type { LoggedInUserInfo } from '../types/user-types.js'; import type { GetENSNames } from '../utils/ens-helpers.js'; import { @@ -80,7 +80,11 @@ } const singleOtherUser = getSingleOtherUser(parentThreadInfo, viewerID); - if (parentThreadType === threadTypes.GENESIS_PERSONAL && singleOtherUser) { + if ( + (parentThreadType === threadTypes.GENESIS_PERSONAL || + parentThreadType === threadTypes.PERSONAL) && + singleOtherUser + ) { const singleOtherUsername = parentThreadInfo.members.find( member => member.id === singleOtherUser, )?.username; @@ -107,7 +111,9 @@ return createPendingThread({ viewerID, - threadType: threadTypes.SIDEBAR, + threadType: threadTypeIsThick(parentThreadInfo.type) + ? threadTypes.THICK_SIDEBAR + : threadTypes.SIDEBAR, members: [...initialMembers.values()], parentThreadInfo, threadColor: color, diff --git a/lib/types/thread-types-enum.js b/lib/types/thread-types-enum.js --- a/lib/types/thread-types-enum.js +++ b/lib/types/thread-types-enum.js @@ -59,6 +59,11 @@ ...thickThreadTypes, }); +const thickThreadTypesSet = new Set(Object.values(thickThreadTypes)); +export function threadTypeIsThick(threadType: ThreadType): boolean { + return thickThreadTypesSet.has(threadType); +} + export function assertThinThreadType(threadType: number): ThinThreadType { invariant( threadType === 3 ||