mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 06:27:02 +03:00
isNonEmptyArray => arrayLength
This commit is contained in:
parent
1e49c1a6ac
commit
5590fd4860
20 changed files with 68 additions and 74 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint key-spacing: 0 */
|
||||
/* eslint quote-props: 0 */
|
||||
|
||||
import { isNonEmptyArray } from 'Common/Utils';
|
||||
import { arrayLength } from 'Common/Utils';
|
||||
|
||||
const
|
||||
cache = {},
|
||||
|
|
@ -250,7 +250,7 @@ export const FileInfo = {
|
|||
* @returns {string}
|
||||
*/
|
||||
getCombinedIconClass: data => {
|
||||
if (isNonEmptyArray(data)) {
|
||||
if (arrayLength(data)) {
|
||||
let icons = data
|
||||
.map(item => item ? FileInfo.getIconClass(FileInfo.getExtension(item[0]), item[1]) : '')
|
||||
.validUnique();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { doc, elementById } from 'Common/Globals';
|
|||
|
||||
export const
|
||||
isArray = Array.isArray,
|
||||
isNonEmptyArray = array => isArray(array) && array.length,
|
||||
arrayLength = array => isArray(array) && array.length,
|
||||
isFunction = v => typeof v === 'function';
|
||||
|
||||
/**
|
||||
|
|
@ -116,7 +116,7 @@ export function changeTheme(value, themeTrigger = ()=>{}) {
|
|||
}
|
||||
rl.fetchJSON(url, init)
|
||||
.then(data => {
|
||||
if (data && isArray(data) && 2 === data.length) {
|
||||
if (2 === arrayLength(data)) {
|
||||
themeStyle.textContent = data[1];
|
||||
themeStyle.dataset.href = url;
|
||||
themeStyle.dataset.theme = data[0];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue