mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
And remove some memory cleanup due to issues with the Contacts view
This commit is contained in:
parent
4e4ba12770
commit
d0bcb5483a
4 changed files with 43 additions and 49 deletions
|
|
@ -4,6 +4,8 @@ import { i18n } from 'Common/Translator';
|
|||
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
||||
const trim = text => null == text ? "" : (text + "").trim();
|
||||
|
||||
class ContactPropertyModel extends AbstractModel {
|
||||
/**
|
||||
* @param {number=} type = Enums.ContactPropertyType.Unknown
|
||||
|
|
@ -34,6 +36,14 @@ class ContactPropertyModel extends AbstractModel {
|
|||
});
|
||||
}
|
||||
|
||||
isType(type) {
|
||||
return this.type && type === this.type();
|
||||
}
|
||||
|
||||
isValid() {
|
||||
return this.value && !!trim(this.value());
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
type: this.type(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue