Bug 1522760: Update sidebar item content which connected. r=jdescottes
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Thu, 28 Feb 2019 17:25:37 +0000
changeset 519721 fc03a8b4a47b443c7839386382fb30a5fa8203a1
parent 519720 a1c9f35a9652aa11b47b65bd18313100c5cb5b63
child 519722 39ceb46c4c4506a846965fe03240cc854b696617
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1522760
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1522760: Update sidebar item content which connected. r=jdescottes Depends on D21181 Differential Revision: https://phabricator.services.mozilla.com/D21182
devtools/client/aboutdebugging-new/src/components/sidebar/Sidebar.js
--- a/devtools/client/aboutdebugging-new/src/components/sidebar/Sidebar.js
+++ b/devtools/client/aboutdebugging-new/src/components/sidebar/Sidebar.js
@@ -91,25 +91,31 @@ class Sidebar extends PureComponent {
     const { dispatch, selectedPage, selectedRuntimeId } = this.props;
 
     return runtimes.map(runtime => {
       const keyId = `${runtime.type}-${runtime.id}`;
       const runtimeHasDetails = !!runtime.runtimeDetails;
       const isSelected = selectedPage === PAGE_TYPES.RUNTIME &&
         runtime.id === selectedRuntimeId;
 
+      let name = runtime.name;
+      if (runtime.type === RUNTIMES.USB && runtimeHasDetails) {
+        // Update the name to be same to the runtime page.
+        name = runtime.runtimeDetails.info.name;
+      }
+
       return SidebarRuntimeItem({
         deviceName: runtime.extra.deviceName,
         dispatch,
         icon,
         key: keyId,
         isConnected: runtimeHasDetails,
         isSelected,
         isUnknown: runtime.isUnknown,
-        name: runtime.name,
+        name,
         runtimeId: runtime.id,
       });
     });
   }
 
   render() {
     const { dispatch, selectedPage, selectedRuntimeId, isScanningUsb } = this.props;