mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Fix for missing replacement text in bodyRanges
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { DataMessageClass } from './textsecure.d';
|
||||
import { MessageAttributesType } from './model-types.d';
|
||||
import { WhatIsThis } from './window.d';
|
||||
import { assert } from './util/assert';
|
||||
|
||||
export async function startApp(): Promise<void> {
|
||||
window.attachmentDownloadQueue = [];
|
||||
try {
|
||||
window.log.info('Initializing SQL in renderer');
|
||||
await window.sqlInitializer.initialize();
|
||||
@@ -2073,11 +2075,20 @@ export async function startApp(): Promise<void> {
|
||||
attachmentsToDownload.length,
|
||||
attachmentDownloadQueue.length
|
||||
);
|
||||
await Promise.all(
|
||||
window.attachmentDownloadQueue = undefined;
|
||||
const messagesWithDownloads = await Promise.all(
|
||||
attachmentsToDownload.map(message =>
|
||||
message.queueAttachmentDownloads()
|
||||
)
|
||||
);
|
||||
const messagesToSave: Array<MessageAttributesType> = [];
|
||||
messagesWithDownloads.forEach((shouldSave, messageKey) => {
|
||||
if (shouldSave) {
|
||||
const message = attachmentsToDownload[messageKey];
|
||||
messagesToSave.push(message.attributes);
|
||||
}
|
||||
});
|
||||
await window.Signal.Data.saveMessages(messagesToSave, {});
|
||||
}
|
||||
}, 500);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user