mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-04 05:52:44 +08:00
30 lines
573 B
JavaScript
30 lines
573 B
JavaScript
import { change } from 'Common/Links';
|
|
|
|
import { AbstractModel } from 'Knoin/AbstractModel';
|
|
|
|
export class AccountModel extends AbstractModel {
|
|
/**
|
|
* @param {string} email
|
|
* @param {boolean=} canBeDelete = true
|
|
* @param {number=} count = 0
|
|
*/
|
|
constructor(email, canBeDelete = true, count = 0) {
|
|
super();
|
|
|
|
this.email = email;
|
|
|
|
this.addObservables({
|
|
count: count,
|
|
deleteAccess: false,
|
|
canBeDeleted: !!canBeDelete
|
|
});
|
|
this.canBeEdit = this.canBeDeleted;
|
|
}
|
|
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
changeAccountLink() {
|
|
return change(this.email);
|
|
}
|
|
}
|