Conversation.getProps: Allow for our own ACI to be missing

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2022-07-25 14:39:59 -07:00 committed by GitHub
parent 9fc1f2c0dc
commit 4844609bc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -1755,7 +1755,7 @@ export class ConversationModel extends window.Backbone
const { customColor, customColorId } = this.getCustomColorData();
const ourACI = window.textsecure.storage.user.getCheckedUuid(UUIDKind.ACI);
const ourACI = window.textsecure.storage.user.getUuid(UUIDKind.ACI);
const ourPNI = window.textsecure.storage.user.getUuid(UUIDKind.PNI);
// TODO: DESKTOP-720
@ -1775,12 +1775,13 @@ export class ConversationModel extends window.Backbone
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
activeAt: this.get('active_at')!,
areWePending:
this.isMemberPending(ourACI) ||
Boolean(
ourPNI && !this.isMember(ourACI) && this.isMemberPending(ourPNI)
),
ourACI &&
(this.isMemberPending(ourACI) ||
Boolean(
ourPNI && !this.isMember(ourACI) && this.isMemberPending(ourPNI)
)),
areWePendingApproval: Boolean(
ourConversationId && this.isMemberAwaitingApproval(ourACI)
ourConversationId && ourACI && this.isMemberAwaitingApproval(ourACI)
),
areWeAdmin: this.areWeAdmin(),
avatars: getAvatarData(this.attributes),