Bug 1500068 - Avoid opening Add-ons panel when a location hash is passed to select another one. r=jdescottes
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 18 Oct 2018 12:36:35 +0000
changeset 490465 14a6f6ecebc25ee188d852a4b12ed3befba3580a
parent 490464 33e352068e35a538ff380ef30749e53946c5bdd3
child 490466 0927741e9110eebe9d55a73f97fd8bb47f2d6bff
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersjdescottes
bugs1500068
milestone64.0a1
Bug 1500068 - Avoid opening Add-ons panel when a location hash is passed to select another one. r=jdescottes Doing this avoid loading the addons panel and doing its related requests, which may still be pending after closing about:debugging. MozReview-Commit-ID: LJjaE5YVgXi Depends on D8867 Differential Revision: https://phabricator.services.mozilla.com/D8868
devtools/client/aboutdebugging/components/Aboutdebugging.js
--- a/devtools/client/aboutdebugging/components/Aboutdebugging.js
+++ b/devtools/client/aboutdebugging/components/Aboutdebugging.js
@@ -55,26 +55,25 @@ class AboutDebuggingApp extends Componen
       telemetry: PropTypes.instanceOf(Telemetry).isRequired
     };
   }
 
   constructor(props) {
     super(props);
 
     this.state = {
-      selectedPanelId: defaultPanelId
+      selectedPanelId: window.location.hash.substr(1) || defaultPanelId
     };
 
     this.onHashChange = this.onHashChange.bind(this);
     this.selectPanel = this.selectPanel.bind(this);
   }
 
   componentDidMount() {
     window.addEventListener("hashchange", this.onHashChange);
-    this.onHashChange();
 
     // aboutdebugging is not connected with a toolbox so we pass -1 as the
     // toolbox session id.
     this.props.telemetry.toolOpened("aboutdebugging", -1, this);
   }
 
   componentWillUnmount() {
     window.removeEventListener("hashchange", this.onHashChange);