Contact presence: Check for array with items, not truthiness

This commit is contained in:
Scott Nonnenberg 2022-04-12 12:37:10 -07:00 committed by GitHub
parent 1a9547c98f
commit a013e43299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1324,7 +1324,7 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
{
attachments,
doForwardMessage,
hasContact: Boolean(message.get('contact')),
hasContact: Boolean(message.get('contact')?.length),
isSticker: Boolean(message.get('sticker')),
messageBody: message.getRawText(),
onClose: () => {
@ -1468,7 +1468,7 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
},
{ ...sendMessageOptions, timestamp }
);
} else if (contact) {
} else if (contact?.length) {
const contactWithHydratedAvatar = await loadContactData(contact);
conversation.enqueueMessageForSend(
{