Simplify message view attachment controls

This commit is contained in:
the-djmaze 2022-05-31 21:17:09 +02:00
parent baff1308e7
commit 5c99a14559
2 changed files with 6 additions and 11 deletions

View file

@ -123,9 +123,6 @@ export class MailMessageView extends AbstractViewRight {
this.fullScreenMode = isFullscreen;
this.toggleFullScreen = toggleFullscreen;
this.messageListOfThreadsLoading = ko.observable(false).extend({ rateLimit: 1 });
this.highlightUnselectedAttachments = ko.observable(false).extend({ falseTimeout: 2000 });
this.downloadAsZipError = ko.observable(false).extend({ falseTimeout: 7000 });
this.messageDomFocused = ko.observable(false).extend({ rateLimit: 0 });
@ -136,7 +133,10 @@ export class MailMessageView extends AbstractViewRight {
this.addComputables({
allowAttachmentControls: () => arrayLength(attachmentsActions) && SettingsCapa('AttachmentsActions'),
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip') && this.allowAttachmentControls(),
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip')
&& (currentMessage() ? currentMessage().attachments : [])
.filter(item => item && !item.isLinked() && item.checked() && item.download)
.length,
lastReplyAction: {
read: this.lastReplyAction_,
@ -538,8 +538,6 @@ export class MailMessageView extends AbstractViewRight {
}
})
.catch(() => this.downloadAsZipError(true));
} else {
this.highlightUnselectedAttachments(true);
}
}