Fix notification text for gifted badges

This commit is contained in:
trevor-signal 2023-05-30 13:33:10 -04:00 committed by GitHub
parent 3c84acc758
commit 9a9c1c5879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -768,11 +768,13 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
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<MessageAttributesType> {
};
}
const fromContact = getContact(this.attributes);
const sender =
fromContact?.getTitle() ?? window.i18n('icu:unknownContact');
return {