beforeMessageSend: Set lastMessage properly to avoid duplicate @mentions

This commit is contained in:
Scott Nonnenberg 2023-05-30 10:05:07 -07:00 committed by GitHub
parent cc233fb980
commit 3c84acc758
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4162,6 +4162,7 @@ export class ConversationModel extends window.Backbone
if (!dontAddMessage) {
this.doAddSingleMessage(message, { isJustSent: true });
}
const notificationData = message.getNotificationData();
const draftProperties = dontClearDraft
? {}
: {
@ -4172,7 +4173,8 @@ export class ConversationModel extends window.Backbone
quotedMessageId: undefined,
lastMessageAuthor: message.getAuthorText(),
lastMessageBodyRanges: message.get('bodyRanges'),
lastMessage: message.getNotificationText(),
lastMessage:
notificationData?.text || message.getNotificationText() || '',
lastMessageStatus: 'sending' as const,
};