mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
Resolve #571 by allowing to give an account a name/label
This commit is contained in:
parent
2ee9d973e2
commit
decbbd8817
13 changed files with 168 additions and 122 deletions
|
|
@ -12,6 +12,7 @@ export class AccountPopupView extends AbstractViewPopup {
|
|||
addObservablesTo(this, {
|
||||
isNew: true,
|
||||
|
||||
name: '',
|
||||
email: '',
|
||||
password: '',
|
||||
|
||||
|
|
@ -40,18 +41,17 @@ export class AccountPopupView extends AbstractViewPopup {
|
|||
}
|
||||
}
|
||||
|
||||
onShow(account) {
|
||||
if (account?.isAdditional()) {
|
||||
this.isNew(false);
|
||||
this.email(account.email);
|
||||
} else {
|
||||
this.isNew(true);
|
||||
this.email('');
|
||||
}
|
||||
onHide() {
|
||||
this.password('');
|
||||
|
||||
this.submitRequest(false);
|
||||
this.submitError('');
|
||||
this.submitErrorAdditional('');
|
||||
}
|
||||
|
||||
onShow(account) {
|
||||
let edit = account?.isAdditional();
|
||||
this.isNew(!edit);
|
||||
this.name(edit ? account.name : '');
|
||||
this.email(edit ? account.email : '');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ export class SystemDropDownUserView extends AbstractViewRight {
|
|||
|
||||
this.accountEmail = AccountUserStore.email;
|
||||
|
||||
this.accounts = AccountUserStore.accounts;
|
||||
this.accounts = AccountUserStore;
|
||||
this.accountsLoading = AccountUserStore.loading;
|
||||
/*
|
||||
this.accountsUnreadCount = : koComputable(() => 0);
|
||||
this.accountsUnreadCount = : koComputable(() => AccountUserStore.accounts().reduce((result, item) => result + item.count(), 0));
|
||||
this.accountsUnreadCount = : koComputable(() => AccountUserStore().reduce((result, item) => result + item.count(), 0));
|
||||
*/
|
||||
|
||||
addObservablesTo(this, {
|
||||
|
|
@ -91,8 +91,10 @@ export class SystemDropDownUserView extends AbstractViewRight {
|
|||
return true;
|
||||
}
|
||||
|
||||
emailTitle() {
|
||||
return AccountUserStore.email();
|
||||
accountName() {
|
||||
let email = AccountUserStore.email(),
|
||||
account = AccountUserStore.find(account => account.email == email);
|
||||
return account?.name || email;
|
||||
}
|
||||
|
||||
settingsClick() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue