Fix incorrect member count in chat details during pending membership

This commit is contained in:
Jamie Kyle 2024-03-26 08:38:18 -07:00 committed by GitHub
parent 79035f5570
commit ebecf2403f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 6 deletions

View file

@ -391,7 +391,7 @@ export function ConversationDetails({
i18n={i18n}
isMe={conversation.isMe}
isGroup={isGroup}
memberships={memberships}
membersCount={conversation.membersCount ?? null}
startEditing={(isGroupTitle: boolean) => {
setModalState(
isGroupTitle

View file

@ -41,7 +41,7 @@ function Wrapper(overrideProps: Partial<Props>) {
i18n={i18n}
canEdit={false}
startEditing={action('startEditing')}
memberships={new Array(0)}
membersCount={0}
isGroup
isMe={false}
theme={theme}

View file

@ -9,7 +9,6 @@ import { AvatarLightbox } from '../../AvatarLightbox';
import type { ConversationType } from '../../../state/ducks/conversations';
import { GroupDescription } from '../GroupDescription';
import { About } from '../About';
import type { GroupV2Membership } from './ConversationDetailsMembershipList';
import type { LocalizerType, ThemeType } from '../../../types/Util';
import { assertDev } from '../../../util/assert';
import { BadgeDialog } from '../../BadgeDialog';
@ -26,7 +25,7 @@ export type Props = {
i18n: LocalizerType;
isGroup: boolean;
isMe: boolean;
memberships: ReadonlyArray<GroupV2Membership>;
membersCount: number | null;
startEditing: (isGroupTitle: boolean) => void;
toggleAboutContactModal: (contactId: string) => void;
theme: ThemeType;
@ -45,7 +44,7 @@ export function ConversationDetailsHeader({
i18n,
isGroup,
isMe,
memberships,
membersCount,
startEditing,
toggleAboutContactModal,
theme,
@ -71,7 +70,7 @@ export function ConversationDetailsHeader({
subtitle = i18n('icu:ConversationDetailsHeader--add-group-description');
} else {
subtitle = i18n('icu:ConversationDetailsHeader--members', {
number: memberships.length,
number: membersCount ?? 0,
});
}
} else if (!isMe) {