mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-28 18:41:34 +08:00
Revert nickname idea (it's not updating as it was not observing)
This commit is contained in:
parent
08ded5bb71
commit
859a18470e
1 changed files with 7 additions and 10 deletions
|
@ -29,7 +29,8 @@ export class ContactModel extends AbstractModel {
|
|||
surName: '', // LastName
|
||||
middleName: '', // MiddleName
|
||||
namePrefix: '', // NamePrefix
|
||||
nameSuffix: '' // NameSuffix
|
||||
nameSuffix: '', // NameSuffix
|
||||
nickname: null
|
||||
});
|
||||
// this.email = koArrayWithDestroy();
|
||||
this.email = ko.observableArray();
|
||||
|
@ -41,15 +42,6 @@ export class ContactModel extends AbstractModel {
|
|||
|
||||
fullName: () => (this.givenName() + ' ' + this.surName()).trim(),
|
||||
|
||||
nickname: {
|
||||
read: () => {
|
||||
let prop = this.jCard.getOne('nickname');
|
||||
return prop && prop.value;
|
||||
},
|
||||
write: value =>
|
||||
value ? this.jCard.set('nickname', value/*, params, group*/) : this.jCard.remove('nickname')
|
||||
},
|
||||
|
||||
display: () => {
|
||||
let a = this.jCard.getOne('fn')?.value,
|
||||
b = this.fullName(),
|
||||
|
@ -98,6 +90,9 @@ export class ContactModel extends AbstractModel {
|
|||
value && contact[nProps[index]](value)
|
||||
);
|
||||
|
||||
props = jCard.getOne('nickname');
|
||||
props && contact.nickname(props.value);
|
||||
|
||||
['email', 'tel', 'url'].forEach(field => {
|
||||
props = jCard.get(field);
|
||||
props && props.forEach(prop => {
|
||||
|
@ -161,6 +156,8 @@ export class ContactModel extends AbstractModel {
|
|||
]/*, params, group*/);
|
||||
// jCard.parseFullName({set:true});
|
||||
|
||||
this.nickname() ? jCard.set('nickname', this.nickname()/*, params, group*/) : jCard.remove('nickname');
|
||||
|
||||
['email', 'tel', 'url'].forEach(field => {
|
||||
let values = this[field].map(item => item.value());
|
||||
jCard.get(field).forEach(prop => {
|
||||
|
|
Loading…
Reference in a new issue