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

@ -1,5 +1,5 @@
import { MessageSetAction } from 'Common/EnumsUser';
import { isNonEmptyArray, pInt } from 'Common/Utils';
import { arrayLength, pInt } from 'Common/Utils';
let FOLDERS_CACHE = {},
FOLDERS_NAME_CACHE = {},
@ -255,7 +255,7 @@ export class MessageFlagsCache
* @param {Array} flags
*/
static storeByFolderAndUid(folder, uid, flags) {
if (isNonEmptyArray(flags)) {
if (arrayLength(flags)) {
this.setFor(folder, uid, flags);
}
}
@ -269,7 +269,7 @@ export class MessageFlagsCache
let unread = 0;
const flags = this.getFor(folder, uid);
if (isNonEmptyArray(flags)) {
if (arrayLength(flags)) {
if (flags[0]) {
unread = 1;
}