Bugfix: Contacts management failed

It had a strange array type structure and buggy
This commit is contained in:
djmaze 2020-10-20 15:37:06 +02:00
parent 0e3275599e
commit 3a315bc543
7 changed files with 44 additions and 40 deletions

View file

@ -34,11 +34,19 @@ class ContactPropertyModel extends AbstractModel {
this.regDisposables([this.placeholderValue, this.largeValue]);
}
toJSON() {
return {
type: this.type(),
typeStr: this.typeStr(),
value: this.value()
};
}
static reviveFromJson(json) {
const property = super.reviveFromJson(json);
if (property) {
property.type(pInt(property.type));
property.typeStr(pInt(property.typeStr));
property.type(pInt(json.type));
property.typeStr(pString(json.typeStr));
property.value(pString(json.value));
return property;
}