And remove some memory cleanup due to issues with the Contacts view
This commit is contained in:
djmaze 2020-10-30 11:49:05 +01:00
parent 4e4ba12770
commit d0bcb5483a
4 changed files with 43 additions and 49 deletions

View file

@ -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(),