Service Notifications: Fix loading media

This commit is contained in:
Alexander Zinchuk 2022-04-19 15:12:13 +02:00
parent 9f7f01b0bd
commit 14b603991f
2 changed files with 3 additions and 2 deletions

View File

@ -632,6 +632,7 @@ addActionHandler('createServiceNotification', (global, actions, payload) => {
// The fractional ID is made of the largest integer ID and an incremented fractional part // The fractional ID is made of the largest integer ID and an incremented fractional part
const id = Math.floor(maxId) + fractionalPart; const id = Math.floor(maxId) + fractionalPart;
message.previousLocalId = message.id;
message.id = id; message.id = id;
const serviceNotification = { const serviceNotification = {

View File

@ -23,9 +23,9 @@ export function getMessageHtmlId(messageId: number) {
} }
export function getMessageKey(message: ApiMessage): MessageKey { export function getMessageKey(message: ApiMessage): MessageKey {
const { chatId, id } = message; const { chatId, id, previousLocalId } = message;
return buildMessageKey(chatId, id); return buildMessageKey(chatId, isServiceNotificationMessage(message) ? previousLocalId || id : id);
} }
export function buildMessageKey(chatId: string, msgId: number): MessageKey { export function buildMessageKey(chatId: string, msgId: number): MessageKey {