From d9864881f231cbbbe17d4d9735254e66c876f63a Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Fri, 27 Apr 2018 06:29:05 +0900 Subject: [PATCH] Bug 1455573 - Part 3: Save the reordering preference when destroying. r=jdescottes MozReview-Commit-ID: AEmnzVkEs9T --HG-- extra : rebase_source : 096d8a080215d78d43fadf52ac88a928025150f4 --- devtools/client/framework/toolbox-tabs-order-manager.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devtools/client/framework/toolbox-tabs-order-manager.js b/devtools/client/framework/toolbox-tabs-order-manager.js index 54aa0cb972ff..b7278902a61b 100644 --- a/devtools/client/framework/toolbox-tabs-order-manager.js +++ b/devtools/client/framework/toolbox-tabs-order-manager.js @@ -25,6 +25,13 @@ class ToolboxTabsOrderManager { destroy() { Services.prefs.removeObserver(PREFERENCE_NAME, this.onOrderUpdated); + + // Save the reordering preference, because some tools might be removed. + const ids = + this.currentPanelDefinitions.map(definition => definition.extensionId || definition.id); + const pref = ids.join(","); + Services.prefs.setCharPref(PREFERENCE_NAME, pref); + this.onMouseUp(); }