Skip to content

Commit

Permalink
#1843 – added possibility to enable/disable redux-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitvex committed Nov 16, 2022
1 parent fb04543 commit 7c58e3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion example/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ module.exports = override(
new webpack.EnvironmentPlugin({
MODE: process.env.MODE,
API_PATH: process.env.REACT_APP_API_PATH,
ENABLE_POLYMER_EDITOR: !!process.env.ENABLE_POLYMER_EDITOR
ENABLE_POLYMER_EDITOR: !!process.env.ENABLE_POLYMER_EDITOR,
KETCHER_ENABLE_REDUX_LOGGER: JSON.stringify(false)
})
),
addWebpackPlugin(
Expand Down
8 changes: 6 additions & 2 deletions packages/ketcher-react/src/script/ui/state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ export default function (options, server, setEditor) {
}

const middleware = [thunk]

if (process.env.NODE_ENV !== 'production') middleware.push(logger)
if (
process.env.NODE_ENV !== 'production' &&
process.env.KETCHER_ENABLE_REDUX_LOGGER === 'true'
) {
middleware.push(logger)
}

const rootReducer = getRootReducer(setEditor)
return createStore(rootReducer, initState, applyMiddleware(...middleware))
Expand Down

0 comments on commit 7c58e3e

Please sign in to comment.