Skip to content

Commit

Permalink
Fix inline image being removed in mail viewer on forward
Browse files Browse the repository at this point in the history
Issue caused by inline images not being replaced after a loadAll call
(without notify) which sanitizes mail body.
This is due to the replaceInlineImages call being inside a
loadCompleteNotification listener.

Fixed by calling loadAll *with* notify in reply. loadAll is also now
only called when necessary.

Related to #6523
Fix #8003

Co-authored-by: paw <[email protected]>
  • Loading branch information
2 people authored and charlag committed Dec 5, 2024
1 parent e5403d1 commit c2f8761
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mail-app/mail/view/MailViewerViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,12 @@ export class MailViewerViewModel {
if (mailboxDetails == null) {
return
}
// Call this again to make sure everything is loaded, including inline images because this can be called earlier than all the parts are loaded.
await this.loadAll(Promise.resolve(), { notify: false })

const isReloadNeeded = !this.sanitizeResult || this.mail.attachments.length !== this.attachments.length
if (isReloadNeeded) {
// Call this again to make sure everything is loaded, including inline images because this can be called earlier than all the parts are loaded.
await this.loadAll(Promise.resolve(), { notify: true })
}
const editor = await newMailEditorAsResponse(args, this.isBlockingExternalImages(), this.getLoadedInlineImages(), mailboxDetails)
editor.show()
}
Expand Down

0 comments on commit c2f8761

Please sign in to comment.