From 85975084e9fa420481609da526b5238e2a3fd8e3 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 28 Feb 2013 12:55:03 -0800 Subject: [PATCH] Uncollapse side panel after enabling file tree Summary: If user enables file tree but had toggled the side panel with 'F' before, it didn't show up. It is confusing. Test Plan: With hidden panel, enabled filetree. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5160 --- .../PhabricatorSettingsPanelDiffPreferences.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php index 451c05979a..ff717909eb 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php @@ -22,9 +22,15 @@ final class PhabricatorSettingsPanelDiffPreferences $pref_filetree = PhabricatorUserPreferences::PREFERENCE_DIFF_FILETREE; if ($request->isFormPost()) { - $preferences->setPreference( - $pref_filetree, - $request->getInt($pref_filetree)); + $filetree = $request->getInt($pref_filetree); + + if ($filetree && !$preferences->getPreference($pref_filetree)) { + $preferences->setPreference( + PhabricatorUserPreferences::PREFERENCE_NAV_COLLAPSED, + false); + } + + $preferences->setPreference($pref_filetree, $filetree); $preferences->save(); return id(new AphrontRedirectResponse())