diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js index e8f0ce45d..4ecb60555 100644 --- a/dev/Knoin/Knoin.js +++ b/dev/Knoin/Knoin.js @@ -206,7 +206,7 @@ const SCREENS = {}, }; export const - popupVisibilityNames = ko.observableArray([]), + popupVisibilityNames = ko.observableArray(), ViewType = { Popup: 'Popups', diff --git a/dev/Model/Message.js b/dev/Model/Message.js index ec8c9e1fd..c633fab81 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -84,6 +84,7 @@ export class MessageModel extends AbstractModel { this.attachments = ko.observableArray(new AttachmentCollectionModel); this.attachmentsSpecData = ko.observableArray(); this.threads = ko.observableArray(); + this.unsubsribeLinks = ko.observableArray(); this.addComputables({ attachmentIconClass: () => FileInfo.getCombinedIconClass(this.hasAttachments() ? this.attachmentsSpecData() : []), @@ -105,7 +106,6 @@ export class MessageModel extends AbstractModel { this.bcc = new EmailCollectionModel; this.replyTo = new EmailCollectionModel; this.deliveredTo = new EmailCollectionModel; - this.unsubsribeLinks = []; this.body = null; this.draftInfo = []; this.messageId = ''; @@ -152,6 +152,7 @@ export class MessageModel extends AbstractModel { this.readReceipt(''); this.threads([]); + this.unsubsribeLinks([]); this.hasUnseenSubMessage(false); this.hasFlaggedSubMessage(false); @@ -201,14 +202,14 @@ export class MessageModel extends AbstractModel { * @returns {boolean} */ hasUnsubsribeLinks() { - return this.unsubsribeLinks && this.unsubsribeLinks.length; + return this.unsubsribeLinks().length; } /** * @returns {string} */ getFirstUnsubsribeLink() { - return this.unsubsribeLinks && this.unsubsribeLinks.length ? this.unsubsribeLinks[0] || '' : ''; + return this.unsubsribeLinks()[0] || ''; } /** @@ -431,7 +432,7 @@ export class MessageModel extends AbstractModel { this.bcc = message.bcc; this.replyTo = message.replyTo; this.deliveredTo = message.deliveredTo; - this.unsubsribeLinks = message.unsubsribeLinks; + this.unsubsribeLinks(message.unsubsribeLinks); this.isUnseen(message.isUnseen()); this.isFlagged(message.isFlagged());