diff --git a/src/chrome/mainsidebar/MainSidebar2.tsx b/src/chrome/mainsidebar/MainSidebar2.tsx index 0ea21c72e..1fc600712 100644 --- a/src/chrome/mainsidebar/MainSidebar2.tsx +++ b/src/chrome/mainsidebar/MainSidebar2.tsx @@ -195,19 +195,16 @@ class MainSidebar2 extends PureComponent { } render() { - const devices = this.props.devices - .slice() - .sort((a, b) => a.title.localeCompare(b.title)); - const renderableDevices = devices.filter(canBeDefaultDevice); - + const {devices} = this.props; return ( - {renderableDevices.length ? ( - renderableDevices.map(device => this.renderDevice(device)) + {devices.length ? ( + devices.map(device => this.renderDevice(device)) ) : ( )} + {this.renderUnitializedClients()} @@ -218,7 +215,6 @@ class MainSidebar2 extends PureComponent { const { selectedPlugin, selectPlugin, - uninitializedClients, clientPlugins, starPlugin, userStarredPlugins, @@ -228,30 +224,41 @@ class MainSidebar2 extends PureComponent { const clients = getAvailableClients(device, this.props.clients); return ( - + {this.showArchivedDeviceDetails(device)} - - {device.devicePlugins.map(pluginName => { - const plugin = this.props.devicePlugins.get(pluginName)!; - return ( - - selectPlugin({ - selectedPlugin: plugin.id, - selectedApp: null, - deepLinkPayload: null, - selectedDevice: device, - }) - } - plugin={plugin} - /> - ); - })} - + {device.devicePlugins.length > 0 ? ( + + {device.devicePlugins.map(pluginName => { + const plugin = this.props.devicePlugins.get(pluginName)!; + return ( + + selectPlugin({ + selectedPlugin: plugin.id, + selectedApp: null, + deepLinkPayload: null, + selectedDevice: device, + }) + } + plugin={plugin} + /> + ); + })} + + ) : null} {clients.length === 0 ? ( ) : ( @@ -269,6 +276,14 @@ class MainSidebar2 extends PureComponent { /> )) )} + + ); + } + + renderUnitializedClients() { + const {uninitializedClients} = this.props; + return uninitializedClients.length > 0 ? ( + {uninitializedClients.map(entry => ( { level={2}> ))} - ); + ) : null; } showArchivedDeviceDetails(device: BaseDevice) { @@ -300,7 +315,7 @@ class MainSidebar2 extends PureComponent { ); return ( <> - + {device.source ? 'Imported device' : 'Archived device'} diff --git a/src/chrome/mainsidebar/sidebarUtils.tsx b/src/chrome/mainsidebar/sidebarUtils.tsx index a3ded1d08..cfa8d0421 100644 --- a/src/chrome/mainsidebar/sidebarUtils.tsx +++ b/src/chrome/mainsidebar/sidebarUtils.tsx @@ -212,7 +212,7 @@ export const NoDevices = () => ( ); export const NoClients = () => ( - +