Remove unused plugin update command / redux action
Summary: This command is never actually dispatched so removing to avoid future confusion. When new plugins are downloaded a check is done here https://fburl.com/code/e3zedljb to see if pluginIsDisabledForAllConnectedClients, if so, load command is queued, which internally calls update (which resets state) If the plugin is not disabled then a message appears asking user to manually reload. Reviewed By: aigoncharov Differential Revision: D44502476 fbshipit-source-id: b796b77f843218c07ee612d9f45cacba073362d3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f8e326f4d5
commit
e47d99a69e
@@ -140,9 +140,6 @@ async function processPluginCommandsQueue(
|
|||||||
case 'UNINSTALL_PLUGIN':
|
case 'UNINSTALL_PLUGIN':
|
||||||
uninstallPlugin(store, command.payload);
|
uninstallPlugin(store, command.payload);
|
||||||
break;
|
break;
|
||||||
case 'UPDATE_PLUGIN':
|
|
||||||
updatePlugin(store, command.payload);
|
|
||||||
break;
|
|
||||||
case 'SWITCH_PLUGIN':
|
case 'SWITCH_PLUGIN':
|
||||||
switchPlugin(store, command.payload);
|
switchPlugin(store, command.payload);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export type State = {
|
|||||||
export type PluginCommand =
|
export type PluginCommand =
|
||||||
| LoadPluginAction
|
| LoadPluginAction
|
||||||
| UninstallPluginAction
|
| UninstallPluginAction
|
||||||
| UpdatePluginAction
|
|
||||||
| SwitchPluginAction;
|
| SwitchPluginAction;
|
||||||
|
|
||||||
export type LoadPluginActionPayload = {
|
export type LoadPluginActionPayload = {
|
||||||
@@ -47,11 +46,6 @@ export type UpdatePluginActionPayload = {
|
|||||||
enablePlugin: boolean;
|
enablePlugin: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UpdatePluginAction = {
|
|
||||||
type: 'UPDATE_PLUGIN';
|
|
||||||
payload: UpdatePluginActionPayload;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type SwitchPluginActionPayload = {
|
export type SwitchPluginActionPayload = {
|
||||||
plugin: PluginDefinition;
|
plugin: PluginDefinition;
|
||||||
selectedApp?: string;
|
selectedApp?: string;
|
||||||
@@ -80,7 +74,6 @@ export default function reducer(
|
|||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case 'LOAD_PLUGIN':
|
case 'LOAD_PLUGIN':
|
||||||
case 'UNINSTALL_PLUGIN':
|
case 'UNINSTALL_PLUGIN':
|
||||||
case 'UPDATE_PLUGIN':
|
|
||||||
case 'SWITCH_PLUGIN':
|
case 'SWITCH_PLUGIN':
|
||||||
return produce(state, (draft) => {
|
return produce(state, (draft) => {
|
||||||
draft.pluginCommandsQueue.push(action);
|
draft.pluginCommandsQueue.push(action);
|
||||||
@@ -111,13 +104,6 @@ export const pluginCommandsProcessed = (payload: number): Action => ({
|
|||||||
payload,
|
payload,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const registerPluginUpdate = (
|
|
||||||
payload: UpdatePluginActionPayload,
|
|
||||||
): Action => ({
|
|
||||||
type: 'UPDATE_PLUGIN',
|
|
||||||
payload,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const switchPlugin = (payload: SwitchPluginActionPayload): Action => ({
|
export const switchPlugin = (payload: SwitchPluginActionPayload): Action => ({
|
||||||
type: 'SWITCH_PLUGIN',
|
type: 'SWITCH_PLUGIN',
|
||||||
payload,
|
payload,
|
||||||
|
|||||||
Reference in New Issue
Block a user