From 40e0a2b705f2542ec13614251ef8d5d90cf9311c Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 13 Aug 2015 08:55:11 +0000 Subject: [PATCH] Mail tree phase2: - Fix mail tree gets stalled after adding new account --- mail/inc/class.mail_ui.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 35e6546ed3..fc7b4b8e21 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -766,7 +766,16 @@ class mail_ui if (!empty($_folderName)) $fetchCounters = true; - $data = $this->mail_tree->getTree($nodeID,$_profileID,0, false,$subscribedOnly,!$this->mail_bo->mailPreferences['showAllFoldersInFolderPane']); + // Check if it is called for refresh root + // then we need to reinitialized the index tree + if(!$nodeID && !$_profileID) + { + $data = $this->mail_tree->getInitialIndexTree(null,null,null,null,true,!$this->mail_bo->mailPreferences['showAllFoldersInFolderPane']); + } + else + { + $data = $this->mail_tree->getTree($nodeID,$_profileID,0, false,$subscribedOnly,!$this->mail_bo->mailPreferences['showAllFoldersInFolderPane']); + } if (!is_null($_nodeID)) return $data; etemplate_widget_tree::send_quote_json($data); }