mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Merge Objects prototype extensions
This commit is contained in:
parent
0647b5201f
commit
f2d194947d
26 changed files with 108 additions and 127 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { ContactPropertyType } from 'Common/Enums';
|
||||
import { isNonEmptyArray, pInt, pString } from 'Common/Utils';
|
||||
import { pInt, pString } from 'Common/Utils';
|
||||
import { emptyContactPic } from 'Common/Links';
|
||||
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
|
@ -28,7 +28,7 @@ class ContactModel extends AbstractModel {
|
|||
let name = '',
|
||||
email = '';
|
||||
|
||||
if (isNonEmptyArray(this.properties)) {
|
||||
if (Array.isNotEmpty(this.properties)) {
|
||||
this.properties.forEach(property => {
|
||||
if (property) {
|
||||
if (ContactPropertyType.FirstName === property[0]) {
|
||||
|
|
@ -56,7 +56,7 @@ class ContactModel extends AbstractModel {
|
|||
this.display = pString(json.Display);
|
||||
this.readOnly = !!json.ReadOnly;
|
||||
|
||||
if (isNonEmptyArray(json.Properties)) {
|
||||
if (Array.isNotEmpty(json.Properties)) {
|
||||
json.Properties.forEach(property => {
|
||||
if (property && property.Type && null != property.Value && null != property.TypeStr) {
|
||||
this.properties.push([pInt(property.Type), pString(property.Value), pString(property.TypeStr)]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue