From 9a9c1c5879c2e839bfa82bf028e0e51a0e41f17c Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Tue, 30 May 2023 13:33:10 -0400 Subject: [PATCH] Fix notification text for gifted badges --- ts/models/messages.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 {