change device plugin support check
Summary: Invert the way device plugin <-> device support works with the long term goal of supporting user defined device plugins Reviewed By: danielbuechele Differential Revision: D10240765 fbshipit-source-id: 9e886518a2fbfd263c79daa4b805c088ab38ab87
This commit is contained in:
committed by
Facebook Github Bot
parent
069f2be335
commit
7527636a38
@@ -182,16 +182,6 @@ class MainSidebar extends Component<MainSidebarProps> {
|
||||
} = this.props;
|
||||
let {clients} = this.props;
|
||||
|
||||
let enabledPlugins = [];
|
||||
for (const devicePlugin of devicePlugins) {
|
||||
if (selectedDevice && selectedDevice.supportsPlugin(devicePlugin)) {
|
||||
enabledPlugins.push(devicePlugin);
|
||||
}
|
||||
}
|
||||
enabledPlugins = enabledPlugins.sort((a, b) => {
|
||||
return (a.title || '').localeCompare(b.title);
|
||||
});
|
||||
|
||||
clients = clients
|
||||
.filter(
|
||||
(client: Client) =>
|
||||
@@ -237,7 +227,7 @@ class MainSidebar extends Component<MainSidebarProps> {
|
||||
)}
|
||||
{selectedDevice &&
|
||||
devicePlugins
|
||||
.filter(selectedDevice.supportsPlugin)
|
||||
.filter(plugin => plugin.supportsDevice(selectedDevice))
|
||||
.map((plugin: Class<FlipperDevicePlugin<>>) => (
|
||||
<PluginSidebarListItem
|
||||
key={plugin.id}
|
||||
|
||||
Reference in New Issue
Block a user