Skip to content

Commit

Permalink
#1843 – added possibility to enable/disable redux-logger (#1847)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitvex authored Nov 16, 2022
1 parent 3a1d36d commit 3ec8818
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 @@ -23,7 +23,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 3ec8818

Please sign in to comment.