mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
isNonEmptyArray => arrayLength
This commit is contained in:
parent
1e49c1a6ac
commit
5590fd4860
20 changed files with 68 additions and 74 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { isNonEmptyArray } from 'Common/Utils';
|
||||
import { arrayLength } from 'Common/Utils';
|
||||
import { ContactPropertyModel, ContactPropertyType } from 'Model/ContactProperty';
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ export class ContactModel extends AbstractModel {
|
|||
let name = '',
|
||||
email = '';
|
||||
|
||||
if (isNonEmptyArray(this.properties)) {
|
||||
if (arrayLength(this.properties)) {
|
||||
this.properties.forEach(property => {
|
||||
if (property) {
|
||||
if (ContactPropertyType.FirstName === property.type()) {
|
||||
|
|
@ -52,7 +52,7 @@ export class ContactModel extends AbstractModel {
|
|||
const contact = super.reviveFromJson(json);
|
||||
if (contact) {
|
||||
let list = [];
|
||||
if (isNonEmptyArray(json.properties)) {
|
||||
if (arrayLength(json.properties)) {
|
||||
json.properties.forEach(property => {
|
||||
property = ContactPropertyModel.reviveFromJson(property);
|
||||
property && list.push(property);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue