From 9fcce59d70c7daca78d99367bce663c28a1919a4 Mon Sep 17 00:00:00 2001 From: zombiej Date: Wed, 27 Feb 2019 15:31:32 +0800 Subject: [PATCH] adjust --- site/theme/template/Layout/index.jsx | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index 252b464bbd..86db4f7557 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -19,19 +19,6 @@ if (typeof window !== 'undefined' && navigator.serviceWorker) { }); } -window.addEventListener('error', function(e) { - // Ignore ResizeObserver error - if (e.message === 'ResizeObserver loop limit exceeded') { - e.stopPropagation(); - e.stopImmediatePropagation(); - } -}); - -if (process.env.NODE_ENV === 'production') { - LogRocket.init('kpuw4z/ant-design'); - setupLogRocketReact(LogRocket); -} - if (typeof window !== 'undefined') { /* eslint-disable global-require */ require('../../static/style'); @@ -41,6 +28,20 @@ if (typeof window !== 'undefined') { window['react-dom'] = ReactDOM; window.antd = require('antd'); /* eslint-enable global-require */ + + // Error log statistic + window.addEventListener('error', function(e) { + // Ignore ResizeObserver error + if (e.message === 'ResizeObserver loop limit exceeded') { + e.stopPropagation(); + e.stopImmediatePropagation(); + } + }); + + if (process.env.NODE_ENV === 'production') { + LogRocket.init('kpuw4z/ant-design'); + setupLogRocketReact(LogRocket); + } } let isMobile = false;