Use the proper method for pulling attachments off disk for retry

pull/272/head
Scott Nonnenberg 6 years ago
parent c936859d09
commit 92c071e083

@ -124,8 +124,8 @@ function initializeMigrations({
const attachmentsPath = getPath(userDataPath);
const readAttachmentData = createReader(attachmentsPath);
const loadAttachmentData = Type.loadData(readAttachmentData);
const loadPreviewData = MessageType.loadPreviewData(readAttachmentData);
const loadQuoteData = MessageType.loadQuoteData(readAttachmentData);
const loadPreviewData = MessageType.loadPreviewData(loadAttachmentData);
const loadQuoteData = MessageType.loadQuoteData(loadAttachmentData);
const getAbsoluteAttachmentPath = createAbsolutePathGetter(attachmentsPath);
const deleteOnDisk = Attachments.createDeleter(attachmentsPath);

@ -469,14 +469,14 @@ exports.loadPreviewData = loadAttachmentData => {
}
return Promise.all(
preview.map(async () => {
if (!preview.image) {
return preview;
preview.map(async item => {
if (!item.image) {
return item;
}
return {
...preview,
image: await loadAttachmentData(preview.image),
...item,
image: await loadAttachmentData(item.image),
};
})
);

Loading…
Cancel
Save