getMembersCount: Return undefined when conversation has no members

This commit is contained in:
Scott Nonnenberg 2021-02-09 16:00:16 -08:00 committed by GitHub
parent a8d7d718b5
commit 2957735a86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1412,9 +1412,9 @@ export class ConversationModel extends window.Backbone.Model<
window.Signal.Data.updateConversation(this.attributes); window.Signal.Data.updateConversation(this.attributes);
} }
getMembersCount(): number { getMembersCount(): number | undefined {
if (this.isPrivate()) { if (this.isPrivate()) {
return 1; return undefined;
} }
const memberList = this.get('membersV2') || this.get('members'); const memberList = this.get('membersV2') || this.get('members');
@ -1429,7 +1429,7 @@ export class ConversationModel extends window.Backbone.Model<
return temporaryMemberCount; return temporaryMemberCount;
} }
return 0; return undefined;
} }
decrementMessageCount(): void { decrementMessageCount(): void {