From e2d6528bf58c217a2d0a8a9ee9a3b4dcc14a2b58 Mon Sep 17 00:00:00 2001 From: djmaze Date: Mon, 8 Mar 2021 15:21:54 +0100 Subject: [PATCH] Bugfix: message threaded mode was broken (knockout computable requires call to observable) --- dev/Model/Message.js | 2 +- dev/View/Popup/Compose.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dev/Model/Message.js b/dev/Model/Message.js index 703f97cd1..dcfdc2cb3 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -86,7 +86,7 @@ export class MessageModel extends AbstractModel { this.addComputables({ attachmentIconClass: () => FileInfo.getCombinedIconClass(this.hasAttachments() ? this.attachmentsSpecData() : []), - threadsLen: () => this.threads.length, + threadsLen: () => this.threads().length, isImportant: () => MessagePriority.High === this.priority(), }); } diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index ff0579e07..7890b6802 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -247,7 +247,6 @@ class ComposePopupView extends AbstractViewPopup { }, attachmentsInProcess: () => this.attachments.filter(item => item && !item.complete()), - attachmentsInReady: () => this.attachments.filter(item => item && item.complete()), attachmentsInError: () => this.attachments.filter(item => item && item.error()), attachmentsCount: () => this.attachments.length, @@ -1318,8 +1317,8 @@ class ComposePopupView extends AbstractViewPopup { */ prepearAttachmentsForSendOrSave() { const result = {}; - this.attachmentsInReady().forEach(item => { - if (item && item.tempName() && item.enabled()) { + this.attachments.forEach(item => { + if (item && item.complete() && item.tempName() && item.enabled()) { result[item.tempName()] = [item.fileName(), item.isInline ? '1' : '0', item.CID, item.contentLocation]; } }); @@ -1417,7 +1416,7 @@ class ComposePopupView extends AbstractViewPopup { isEmptyForm(includeAttachmentInProgress = true) { const withoutAttachment = includeAttachmentInProgress ? !this.attachments.length - : !this.attachmentsInReady().length; + : !this.attachments.some(item => item && item.complete()); return ( !this.to.length &&