(js) Fix saving the preferences with Mail disabled

pull/234/head
Francis Lachapelle 2017-01-27 12:38:01 -05:00
parent ac127a375f
commit 88bc1294cd
2 changed files with 16 additions and 11 deletions

3
NEWS
View File

@ -4,6 +4,9 @@
Enhancements
- [web] added Hebrew (he) translation - thanks to Raz Aidlitz
Bug fixes
- [web] saving the preferences was not possible when Mail module is disabled
3.2.6a (2017-01-26)
-------------------

View File

@ -45,17 +45,19 @@
vm.validateVacationEndDate = validateVacationEndDate;
// Fetch a flatten version of the mailboxes list of the main account (0)
// This list will be forwarded to the Sieve filter controller
account = new Account({ id: 0 });
account.$getMailboxes().then(function() {
var allMailboxes = account.$flattenMailboxes({all: true}),
index = -1,
length = allMailboxes.length;
while (++index < length) {
mailboxes.push(allMailboxes[index]);
}
});
if (sgSettings.activeUser('path').mail) {
// Fetch a flatten version of the mailboxes list of the main account (0)
// This list will be forwarded to the Sieve filter controller
account = new Account({ id: 0 });
account.$getMailboxes().then(function() {
var allMailboxes = account.$flattenMailboxes({all: true}),
index = -1,
length = allMailboxes.length;
while (++index < length) {
mailboxes.push(allMailboxes[index]);
}
});
}
// Set alternate avatar in User service
statePreferences.ready().then(function() {