diff --git a/ts/models/messages.ts b/ts/models/messages.ts index 3ae552d9d..e57d2b79a 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -768,11 +768,13 @@ export class MessageModel extends window.Backbone.Model { const giftBadge = this.get('giftBadge'); if (giftBadge) { const emoji = '✨'; - const fromContact = getContact(this.attributes); if (isOutgoing(this.attributes)) { + const toContact = window.ConversationController.get( + this.attributes.conversationId + ); const recipient = - fromContact?.getTitle() ?? window.i18n('icu:unknownContact'); + toContact?.getTitle() ?? window.i18n('icu:unknownContact'); return { emoji, text: window.i18n('icu:message--donation--preview--sent', { @@ -781,6 +783,7 @@ export class MessageModel extends window.Backbone.Model { }; } + const fromContact = getContact(this.attributes); const sender = fromContact?.getTitle() ?? window.i18n('icu:unknownContact'); return {