mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-10-03 02:14:19 +08:00
Make unsubsribeLinks observable
This commit is contained in:
parent
448120b665
commit
fa25be0631
2 changed files with 6 additions and 5 deletions
|
@ -206,7 +206,7 @@ const SCREENS = {},
|
|||
};
|
||||
|
||||
export const
|
||||
popupVisibilityNames = ko.observableArray([]),
|
||||
popupVisibilityNames = ko.observableArray(),
|
||||
|
||||
ViewType = {
|
||||
Popup: 'Popups',
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue