mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
Bugfix: subscribables should be created after computables
This commit is contained in:
parent
f25d210f3e
commit
8d7e25fc7c
3 changed files with 102 additions and 102 deletions
|
|
@ -60,6 +60,52 @@ class DomainPopupView extends AbstractViewNext {
|
|||
enableSmartPorts: false
|
||||
});
|
||||
|
||||
this.addComputables({
|
||||
allowSieve: () => CapaAdminStore.filters() && CapaAdminStore.sieve(),
|
||||
|
||||
headerText: () => {
|
||||
const name = this.name(),
|
||||
aliasName = this.aliasName();
|
||||
|
||||
let result = '';
|
||||
|
||||
if (this.edit()) {
|
||||
result = i18n('POPUPS_DOMAIN/TITLE_EDIT_DOMAIN', { 'NAME': name });
|
||||
if (aliasName) {
|
||||
result += ' ← ' + aliasName;
|
||||
}
|
||||
} else {
|
||||
result = name
|
||||
? i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN_WITH_NAME', { 'NAME': name })
|
||||
: i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN');
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
domainDesc: () => {
|
||||
const name = this.name();
|
||||
return !this.edit() && name ? i18n('POPUPS_DOMAIN/NEW_DOMAIN_DESC', { 'NAME': '*@' + name }) : '';
|
||||
},
|
||||
|
||||
domainIsComputed: () => {
|
||||
const usePhpMail = this.smtpPhpMail(),
|
||||
allowSieve = this.allowSieve(),
|
||||
useSieve = this.useSieve();
|
||||
|
||||
return (
|
||||
this.name() &&
|
||||
this.imapServer() &&
|
||||
this.imapPort() &&
|
||||
(allowSieve && useSieve ? this.sieveServer() && this.sievePort() : true) &&
|
||||
((this.smtpServer() && this.smtpPort()) || usePhpMail)
|
||||
);
|
||||
},
|
||||
|
||||
canBeTested: () => !this.testing() && this.domainIsComputed(),
|
||||
canBeSaved: () => !this.saving() && this.domainIsComputed()
|
||||
});
|
||||
|
||||
this.addSubscribables({
|
||||
testingImapError: value => value || this.testingImapErrorDesc(''),
|
||||
testingSieveError: value => value || this.testingSieveErrorDesc(''),
|
||||
|
|
@ -121,52 +167,6 @@ class DomainPopupView extends AbstractViewNext {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.addComputables({
|
||||
allowSieve: () => CapaAdminStore.filters() && CapaAdminStore.sieve(),
|
||||
|
||||
headerText: () => {
|
||||
const name = this.name(),
|
||||
aliasName = this.aliasName();
|
||||
|
||||
let result = '';
|
||||
|
||||
if (this.edit()) {
|
||||
result = i18n('POPUPS_DOMAIN/TITLE_EDIT_DOMAIN', { 'NAME': name });
|
||||
if (aliasName) {
|
||||
result += ' ← ' + aliasName;
|
||||
}
|
||||
} else {
|
||||
result = name
|
||||
? i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN_WITH_NAME', { 'NAME': name })
|
||||
: i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN');
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
domainDesc: () => {
|
||||
const name = this.name();
|
||||
return !this.edit() && name ? i18n('POPUPS_DOMAIN/NEW_DOMAIN_DESC', { 'NAME': '*@' + name }) : '';
|
||||
},
|
||||
|
||||
domainIsComputed: () => {
|
||||
const usePhpMail = this.smtpPhpMail(),
|
||||
allowSieve = this.allowSieve(),
|
||||
useSieve = this.useSieve();
|
||||
|
||||
return (
|
||||
this.name() &&
|
||||
this.imapServer() &&
|
||||
this.imapPort() &&
|
||||
(allowSieve && useSieve ? this.sieveServer() && this.sievePort() : true) &&
|
||||
((this.smtpServer() && this.smtpPort()) || usePhpMail)
|
||||
);
|
||||
},
|
||||
|
||||
canBeTested: () => !this.testing() && this.domainIsComputed(),
|
||||
canBeSaved: () => !this.saving() && this.domainIsComputed()
|
||||
});
|
||||
}
|
||||
|
||||
@command((self) => self.canBeSaved())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue