[FIX] mail: Allow to navigate quickly among the different attachments

What are the steps to reproduce your issue ?

    1. Create a record and add two attachments
    2. Navigate quickly between these attachments

What is currently happening ?

    Traceback
    TypeError: Cannot read property 'complete' of undefined
        at AttachmentViewer._handleImageLoad (https://www.odoo.com/mail/static/src/components/attachment_viewer/attachment_viewer.js:163:20)

opw-2521901

closes odoo/odoo#70334

X-original-commit: 2b3ad9bfa9459b8e39d769afa8fa61ceef925c75
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Achraf (abz)
2021-05-04 13:28:14 +00:00
parent 0d32ed45ae
commit 40204d6575
@@ -163,7 +163,7 @@ class AttachmentViewer extends Component {
const image = refs[`image_${this.attachmentViewer.attachment.id}`];
if (
this.attachmentViewer.attachment.fileType === 'image' &&
!image.complete
(!image || !image.complete)
) {
this.attachmentViewer.update({ isImageLoading: true });
}