Improved additional account management

This commit is contained in:
djmaze 2021-11-15 10:56:52 +01:00
parent b057c4083e
commit 6b8020b8f5
15 changed files with 161 additions and 161 deletions

View file

@ -1,5 +1,3 @@
import { change } from 'Common/Links';
import { AbstractModel } from 'Knoin/AbstractModel';
export class AccountModel extends AbstractModel {
@ -8,23 +6,16 @@ export class AccountModel extends AbstractModel {
* @param {boolean=} canBeDelete = true
* @param {number=} count = 0
*/
constructor(email, canBeDelete = true, count = 0) {
constructor(email, count = 0, isAdditional = true) {
super();
this.email = email;
this.addObservables({
count: count,
count: count || 0,
deleteAccess: false,
canBeDeleted: !!canBeDelete
isAdditional: isAdditional
});
this.canBeEdit = this.canBeDeleted;
}
/**
* @returns {string}
*/
changeAccountLink() {
return change(this.email);
}
}