diff --git a/src/dispatcher/server.js b/src/dispatcher/server.js index 3057bac8f..f477dfb12 100644 --- a/src/dispatcher/server.js +++ b/src/dispatcher/server.js @@ -38,7 +38,7 @@ export default (store: Store, logger: Logger) => { store.dispatch({ type: 'CLEAR_PLUGIN_STATE', payload: { - id, + clientId: id, devicePlugins: new Set([ ...store.getState().plugins.devicePlugins.keys(), ]), diff --git a/src/reducers/__tests__/pluginStates.node.js b/src/reducers/__tests__/pluginStates.node.js index 57c5a7bd2..ae8c17844 100644 --- a/src/reducers/__tests__/pluginStates.node.js +++ b/src/reducers/__tests__/pluginStates.node.js @@ -22,7 +22,7 @@ test('CLEAR_PLUGIN_STATE removes plugin state', () => { const action: Action = { type: 'CLEAR_PLUGIN_STATE', - payload: {id: clientId, devicePlugins: new Set()}, + payload: {clientId: clientId, devicePlugins: new Set()}, }; const result = reducer( {[pluginKey]: {a: 1}, 'anotherPlugin#key': {b: 2}}, diff --git a/src/reducers/pluginStates.js b/src/reducers/pluginStates.js index 6f899971a..361652c70 100644 --- a/src/reducers/pluginStates.js +++ b/src/reducers/pluginStates.js @@ -23,7 +23,7 @@ export type Action = } | { type: 'CLEAR_PLUGIN_STATE', - payload: {id: string, devicePlugins: Set}, + payload: {clientId: string, devicePlugins: Set}, }; const INITIAL_STATE: State = {}; @@ -51,7 +51,10 @@ export default function reducer( // was removed. pluginKeys are in the form of ${clientID}#${pluginID}. const clientId = pluginKey.slice(0, pluginKey.lastIndexOf('#')); const pluginId = pluginKey.split('#').pop(); - if (clientId !== payload.id || payload.devicePlugins.has(pluginId)) { + if ( + clientId !== payload.clientId || + payload.devicePlugins.has(pluginId) + ) { newState[pluginKey] = state[pluginKey]; } return newState;