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
@@ -17,10 +17,9 @@ import {addStatusMessage, removeStatusMessage} from './application';
|
||||
import constants from '../fb-stubs/constants';
|
||||
import {getInstance} from '../fb-stubs/Logger';
|
||||
import {logPlatformSuccessRate} from '../utils/metrics';
|
||||
import {getExportablePlugins} from '../utils/pluginUtils';
|
||||
export const SUPPORT_FORM_PREFIX = 'support-form-v2';
|
||||
import Client from '../Client';
|
||||
import BaseDevice, {OS} from '../devices/BaseDevice';
|
||||
import {OS} from '../devices/BaseDevice';
|
||||
import {getExportablePlugins} from '../selectors/connections';
|
||||
|
||||
const {DEFAULT_SUPPORT_GROUP} = constants;
|
||||
|
||||
@@ -193,11 +192,7 @@ export class Group {
|
||||
selectedGroup: this,
|
||||
}),
|
||||
);
|
||||
const pluginsList = getExportablePlugins(
|
||||
store.getState(),
|
||||
store.getState().connections.selectedDevice ?? undefined,
|
||||
selectedClient,
|
||||
);
|
||||
const pluginsList = getExportablePlugins(store.getState());
|
||||
|
||||
store.dispatch(
|
||||
setSelectedPlugins(
|
||||
@@ -220,10 +215,8 @@ export class Group {
|
||||
|
||||
getWarningMessage(
|
||||
state: Parameters<typeof getExportablePlugins>[0],
|
||||
device: BaseDevice | undefined,
|
||||
client: Client,
|
||||
): string | null {
|
||||
const activePersistentPlugins = getExportablePlugins(state, device, client);
|
||||
const activePersistentPlugins = getExportablePlugins(state);
|
||||
const emptyPlugins: Array<string> = [];
|
||||
for (const plugin of this.requiredPlugins) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user