(js) Improve handling of IMAP timeout handling
For external accounts only.pull/236/head
parent
ab50a41a86
commit
2b4e357da6
1
NEWS
1
NEWS
|
@ -6,6 +6,7 @@ New features
|
||||||
|
|
||||||
Enhancements
|
Enhancements
|
||||||
- [core] improved event initation for all day events (#4145)
|
- [core] improved event initation for all day events (#4145)
|
||||||
|
- [web] improved interface refresh time with external IMAP accounts
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
- [web] fixed attachment path when inside multiple body parts
|
- [web] fixed attachment path when inside multiple body parts
|
||||||
|
|
|
@ -146,16 +146,21 @@
|
||||||
/**
|
/**
|
||||||
* @ngInject
|
* @ngInject
|
||||||
*/
|
*/
|
||||||
stateAccounts.$inject = ['$q', 'Account'];
|
stateAccounts.$inject = ['$window', '$q', 'Account'];
|
||||||
function stateAccounts($q, Account) {
|
function stateAccounts($window, $q, Account) {
|
||||||
var accounts = Account.$findAll(window.mailAccounts),
|
var accounts = Account.$findAll($window.mailAccounts),
|
||||||
promises = [];
|
promises = [];
|
||||||
// Fetch list of mailboxes for each account
|
// Fetch list of mailboxes for each account
|
||||||
angular.forEach(accounts, function(account, i) {
|
angular.forEach(accounts, function(account, i) {
|
||||||
var mailboxes = account.$getMailboxes();
|
var mailboxes = account.$getMailboxes();
|
||||||
promises.push(mailboxes.then(function(objects) {
|
if (i === 0)
|
||||||
return account;
|
// Make sure we have the list of mailboxes of the first account
|
||||||
}));
|
promises.push(mailboxes.then(function(objects) {
|
||||||
|
return account;
|
||||||
|
}));
|
||||||
|
else
|
||||||
|
// Don't wait for external accounts
|
||||||
|
promises.push(account);
|
||||||
});
|
});
|
||||||
return $q.all(promises);
|
return $q.all(promises);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue