From 7c58e3e4b3926ae60d2409ef3856dbb260a7d8f5 Mon Sep 17 00:00:00 2001 From: Nikita_Vozisov Date: Wed, 16 Nov 2022 13:31:13 +0300 Subject: [PATCH] =?UTF-8?q?=20=20#1843=20=E2=80=93=20added=20possibility?= =?UTF-8?q?=20to=20enable/disable=20redux-logger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/config/webpack.config.js | 3 ++- packages/ketcher-react/src/script/ui/state/index.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/example/config/webpack.config.js b/example/config/webpack.config.js index 895517e192..ce9d4f8a78 100644 --- a/example/config/webpack.config.js +++ b/example/config/webpack.config.js @@ -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( diff --git a/packages/ketcher-react/src/script/ui/state/index.js b/packages/ketcher-react/src/script/ui/state/index.js index 5345fc00f5..7a72362c8c 100644 --- a/packages/ketcher-react/src/script/ui/state/index.js +++ b/packages/ketcher-react/src/script/ui/state/index.js @@ -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))