Use selectors to compute plugin lists according to the selected device and app
Summary: Use selectors to re-compute and cache plugin lists according to the selected device and app. Reviewed By: mweststrate Differential Revision: D29247845 fbshipit-source-id: 4bc669d5d441d605c4090086c4ce59b6d9684a4c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1d26faeacb
commit
ff5d8ba29f
@@ -13,7 +13,6 @@ import {ShareType} from '../reducers/application';
|
||||
import {State as Store} from '../reducers';
|
||||
import {ActiveSheet} from '../reducers/application';
|
||||
import {selectedPlugins as actionForSelectedPlugins} from '../reducers/plugins';
|
||||
import {getExportablePlugins} from '../utils/pluginUtils';
|
||||
import {
|
||||
ACTIVE_SHEET_SHARE_DATA,
|
||||
setActiveSheet as getActiveSheetAction,
|
||||
@@ -23,6 +22,7 @@ import ListView from './ListView';
|
||||
import {Dispatch, Action} from 'redux';
|
||||
import {unsetShare} from '../reducers/application';
|
||||
import {FlexColumn, styled} from '../ui';
|
||||
import {getExportablePlugins} from '../selectors/connections';
|
||||
|
||||
type OwnProps = {
|
||||
onHide: () => void;
|
||||
@@ -104,14 +104,7 @@ class ExportDataPluginSheet extends Component<Props, {}> {
|
||||
|
||||
export default connect<StateFromProps, DispatchFromProps, OwnProps, Store>(
|
||||
(state) => {
|
||||
const selectedClient = state.connections.clients.find((o) => {
|
||||
return o.id === state.connections.selectedApp;
|
||||
});
|
||||
const availablePluginsToExport = getExportablePlugins(
|
||||
state,
|
||||
state.connections.selectedDevice ?? undefined,
|
||||
selectedClient,
|
||||
);
|
||||
const availablePluginsToExport = getExportablePlugins(state);
|
||||
return {
|
||||
share: state.application.share,
|
||||
selectedPlugins: state.plugins.selectedPlugins,
|
||||
|
||||
Reference in New Issue
Block a user