mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Contact add Note and improved changes check
This commit is contained in:
parent
f451af2188
commit
9dcdd7e41c
40 changed files with 61 additions and 125 deletions
|
|
@ -250,7 +250,7 @@ export class ContactModel extends AbstractModel {
|
|||
|
||||
hasChanges()
|
||||
{
|
||||
return this.toJSON().jCard != JSON.stringify(this.jCard);
|
||||
return this.email().filter(v => v.length).length && this.toJSON().jCard != JSON.stringify(this.jCard);
|
||||
}
|
||||
|
||||
toJSON()
|
||||
|
|
|
|||
|
|
@ -199,14 +199,15 @@ export class ContactsPopupView extends AbstractViewPopup {
|
|||
* @param {?ContactModel} contact
|
||||
*/
|
||||
populateViewContact(contact) {
|
||||
const oldContact = this.contact();
|
||||
const oldContact = this.contact(),
|
||||
fn = () => this.contact(contact);
|
||||
if (oldContact?.hasChanges()) {
|
||||
AskPopupView.showModal([
|
||||
i18n('GLOBAL/SAVE_CHANGES'),
|
||||
() => this.saveContact(oldContact)
|
||||
() => this.saveContact(oldContact) | fn(),
|
||||
fn
|
||||
]);
|
||||
}
|
||||
this.contact(contact);
|
||||
} else fn();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue