mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-27 00:36:44 +03:00
IdentityModel extends EmailModel
This commit is contained in:
parent
b01072e2e3
commit
f0b3d798bc
6 changed files with 27 additions and 21 deletions
|
|
@ -73,4 +73,9 @@ export class EmailModel extends AbstractModel {
|
|||
}
|
||||
return result || name;
|
||||
}
|
||||
|
||||
get domain() {
|
||||
return this.email.replace(/^.+@([^@]+)$/, '$1');
|
||||
// return this.email.slice(this.email.lastIndexOf('@'))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
//import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
import { EmailModel } from 'Model/Email';
|
||||
import { addObservablesTo, addComputablesTo } from 'External/ko';
|
||||
|
||||
export class IdentityModel extends AbstractModel {
|
||||
export class IdentityModel extends EmailModel /*AbstractModel*/ {
|
||||
/**
|
||||
* @param {string} id
|
||||
* @param {string} email
|
||||
|
|
@ -12,8 +13,8 @@ export class IdentityModel extends AbstractModel {
|
|||
addObservablesTo(this, {
|
||||
id: '',
|
||||
label: '',
|
||||
email: '',
|
||||
name: '',
|
||||
// email: '',
|
||||
// name: '',
|
||||
|
||||
replyTo: '',
|
||||
bcc: '',
|
||||
|
|
@ -44,8 +45,8 @@ export class IdentityModel extends AbstractModel {
|
|||
* @returns {string}
|
||||
*/
|
||||
formattedName() {
|
||||
const name = this.name(),
|
||||
email = this.email(),
|
||||
const name = this.name,
|
||||
email = this.email,
|
||||
label = this.label();
|
||||
return (name ? `${name} ` : '') + `<${email}>` + (label ? ` (${label})` : '');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue