isNonEmptyArray => arrayLength

This commit is contained in:
djmaze 2021-07-21 21:34:17 +02:00
parent 1e49c1a6ac
commit 5590fd4860
20 changed files with 68 additions and 74 deletions

View file

@ -16,7 +16,7 @@ import {
import { doc, $htmlCL, leftPanelDisabled, keyScopeReal, moveAction, Settings } from 'Common/Globals';
import { isNonEmptyArray, inFocus } from 'Common/Utils';
import { arrayLength, inFocus } from 'Common/Utils';
import { mailToHelper, showMessageComposer } from 'Common/UtilsUser';
import { SMAudio } from 'Common/Audio';
@ -78,7 +78,7 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
this.allowMessageListActions = Settings.capa(Capa.MessageListActions);
const attachmentsActions = Settings.app('attachmentsActions');
this.attachmentsActions = ko.observableArray(isNonEmptyArray(attachmentsActions) ? attachmentsActions : []);
this.attachmentsActions = ko.observableArray(arrayLength(attachmentsActions) ? attachmentsActions : []);
this.message = MessageUserStore.message;
this.hasCheckedMessages = MessageUserStore.hasCheckedMessages;
@ -176,10 +176,8 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
viewFromDkimStatusTitle:() => {
const status = this.viewFromDkimData();
if (isNonEmptyArray(status)) {
if (status[0]) {
return status[1] || 'DKIM: ' + status[0];
}
if (arrayLength(status) && status[0]) {
return status[1] || 'DKIM: ' + status[0];
}
return '';