From 1c7ad9a8aca7d59e62056925f5af9d195de637d7 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 6 Jun 2017 17:29:56 -0300 Subject: [PATCH] Plugin reducers working again with reducer name --- client/coral-embed-stream/src/actions/stream.js | 2 +- client/coral-framework/helpers/plugins.js | 4 +--- client/coral-framework/reducers/index.js | 2 +- plugins/coral-plugin-offtopic/client/reducer.js | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/client/coral-embed-stream/src/actions/stream.js b/client/coral-embed-stream/src/actions/stream.js index 29e6948a0..68ccdda58 100644 --- a/client/coral-embed-stream/src/actions/stream.js +++ b/client/coral-embed-stream/src/actions/stream.js @@ -45,4 +45,4 @@ export const openViewingOptions = () => ({ export const closeViewingOptions = () => ({ type: actions.CLOSE_VIEWING_OPTIONS -}); \ No newline at end of file +}); diff --git a/client/coral-framework/helpers/plugins.js b/client/coral-framework/helpers/plugins.js index 997c5c29d..a9e5f6408 100644 --- a/client/coral-framework/helpers/plugins.js +++ b/client/coral-framework/helpers/plugins.js @@ -11,9 +11,7 @@ import {loadTranslations} from 'coral-framework/services/i18n'; export const pluginReducers = merge( ...plugins .filter((o) => o.module.reducer) - .map(o => ({ - [o.plugin] : o.module.reducer - })) + .map((o) => ({[o.module.reducer.name] : o.module.reducer})) ); /** diff --git a/client/coral-framework/reducers/index.js b/client/coral-framework/reducers/index.js index a25daee5c..8c7a3277b 100644 --- a/client/coral-framework/reducers/index.js +++ b/client/coral-framework/reducers/index.js @@ -3,7 +3,7 @@ import user from './user'; import asset from './asset'; import {reducer as commentBox} from '../../coral-plugin-commentbox'; import {pluginReducers} from '../helpers/plugins'; -console.log(pluginReducers) +console.log(pluginReducers); export default { auth, user, diff --git a/plugins/coral-plugin-offtopic/client/reducer.js b/plugins/coral-plugin-offtopic/client/reducer.js index f5673b1a9..df5612a25 100644 --- a/plugins/coral-plugin-offtopic/client/reducer.js +++ b/plugins/coral-plugin-offtopic/client/reducer.js @@ -4,7 +4,7 @@ const initialState = { export default function offTopic (state = initialState, action) { switch (action.type) { - default : - return state; + default : + return state; } }