Attachments array to new AttachmentCollectionModel

This commit is contained in:
djmaze 2020-09-15 15:08:08 +02:00
parent 344edaec2a
commit e99a69a9aa
5 changed files with 70 additions and 105 deletions

View file

@ -1162,7 +1162,7 @@ class ComposePopupView extends AbstractViewNext {
cancelAttachmentHelper(id, oJua) {
return () => {
const attachment = this.attachments().find(item => item && item.id === id);
const attachment = this.getAttachmentById(id);
if (attachment) {
this.attachments.remove(attachment);
delegateRunOnDestroy(attachment);
@ -1367,8 +1367,7 @@ class ComposePopupView extends AbstractViewNext {
if (ComposeType.ForwardAsAttachment === type) {
this.addMessageAsAttachment(message);
} else {
const attachments = message.attachments();
(Array.isNotEmpty(attachments) ? attachments : []).forEach(item => {
message.attachments.forEach(item => {
let add = false;
switch (type) {
case ComposeType.Reply:
@ -1409,14 +1408,6 @@ class ComposePopupView extends AbstractViewNext {
}
}
removeLinkedAttachments() {
const arrachment = this.attachments().find(item => item && item.isLinked);
if (arrachment) {
this.attachments.remove(arrachment);
delegateRunOnDestroy(arrachment);
}
}
setMessageAttachmentFailedDownloadText() {
this.attachments().forEach(attachment => {
if (attachment && attachment.fromMessage) {