Get folders status asynchronously as it is an expensive operation to be called in initial load

This commit is contained in:
Hadi Nategh 2015-10-06 10:51:35 +00:00
parent 658dcb121e
commit fe9dcbcc12
2 changed files with 5 additions and 2 deletions

View File

@ -240,7 +240,7 @@ class mail_tree
} }
//List of folders //List of folders
$foldersList = $this->ui->mail_bo->getFolderArrays(null, true, $_allInOneGo?0:2,$_subscribedOnly, true); $foldersList = $this->ui->mail_bo->getFolderArrays(null, true, $_allInOneGo?0:2,$_subscribedOnly, false);
foreach ($foldersList as &$folder) foreach ($foldersList as &$folder)
{ {
$path = $parent = $parts = explode($folder['delimiter'], $folder['MAILBOX']); $path = $parent = $parts = explode($folder['delimiter'], $folder['MAILBOX']);

View File

@ -170,6 +170,9 @@ app.classes.mail = AppJS.extend(
this.mail_isMainWindow = true; this.mail_isMainWindow = true;
this.mail_disablePreviewArea(true); this.mail_disablePreviewArea(true);
//Get initial folder status
this.mail_refreshFolderStatus(undefined,undefined,false);
// Bind to nextmatch refresh to update folder status // Bind to nextmatch refresh to update folder status
if(nm != null && (typeof jQuery._data(nm).events=='undefined'||typeof jQuery._data(nm).events.refresh == 'undefined')) if(nm != null && (typeof jQuery._data(nm).events=='undefined'||typeof jQuery._data(nm).events.refresh == 'undefined'))
{ {