mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
parent
25a786d584
commit
2037f21c45
6 changed files with 19 additions and 14 deletions
|
|
@ -21,7 +21,6 @@ export class AttachmentModel extends AbstractModel {
|
|||
this.fileNameExt = '';
|
||||
this.fileType = FileType.Unknown;
|
||||
this.friendlySize = '';
|
||||
this.isLinked = false;
|
||||
this.isThumbnail = false;
|
||||
this.cid = '';
|
||||
this.contentLocation = '';
|
||||
|
|
@ -33,7 +32,8 @@ export class AttachmentModel extends AbstractModel {
|
|||
this.framed = false;
|
||||
|
||||
this.addObservables({
|
||||
isInline: false
|
||||
isInline: false,
|
||||
isLinked: false
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export class AttachmentCollectionModel extends AbstractCollectionModel
|
|||
* @returns {boolean}
|
||||
*/
|
||||
hasVisible() {
|
||||
return !!this.find(item => !item.isLinked);
|
||||
return !!this.filter(item => !item.isLinked()).length;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ export class ComposeAttachmentModel extends AbstractModel {
|
|||
item.download,
|
||||
item.fileName,
|
||||
item.estimatedSize,
|
||||
item.isInline,
|
||||
item.isLinked,
|
||||
item.isInline(),
|
||||
item.isLinked(),
|
||||
item.cid,
|
||||
item.contentLocation
|
||||
);
|
||||
|
|
|
|||
|
|
@ -397,8 +397,10 @@ export class MessageModel extends AbstractModel {
|
|||
|
||||
// Hide valid inline attachments in message view 'attachments' section
|
||||
oAttachments.forEach(oAttachment => {
|
||||
oAttachment.isLinked = result.foundCIDs.includes(oAttachment.contentId())
|
||||
|| result.foundContentLocationUrls.includes(oAttachment.contentLocation)
|
||||
let cid = oAttachment.contentId(),
|
||||
found = result.foundCIDs.includes(cid);
|
||||
oAttachment.isInline(found);
|
||||
oAttachment.isLinked(found || result.foundContentLocationUrls.includes(oAttachment.contentLocation));
|
||||
});
|
||||
this.hasAttachments(oAttachments.hasVisible());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue