add logrocket (#370)

* add logrocket

* disable logrocket in development
This commit is contained in:
Iuri Matias 2019-07-12 11:09:42 -04:00 committed by Richard Ramos
parent f0a08f489c
commit 2998ada711
4 changed files with 34 additions and 1 deletions

View File

@ -63,6 +63,8 @@
"i18next-browser-languagedetector": "^2.2.4",
"identicon.js": "^2.3.3",
"lodash": "^4.17.11",
"logrocket": "^1.0.1",
"logrocket-react": "^3.0.0",
"merge": "^1.2.1",
"moment": "^2.23.0",
"number-to-bn": "^1.7.0",

View File

@ -6,6 +6,9 @@ import { I18nextProvider } from 'react-i18next';
import i18n from './js/i18n';
import { PersistGate } from 'redux-persist/integration/react';
import LogRocket from 'logrocket';
import setupLogRocketReact from 'logrocket-react';
import './css/fonts/Inter/inter.css';
import './css/bootstrap-overrides.scss';
import './index.scss';
@ -15,6 +18,11 @@ import App from './js/layout/App';
import history from './js/history';
import {store, persistor} from './js/store';
if (!process || !process.env || process.env.NODE_ENV !== 'development') {
LogRocket.init('lqnuu9/teller-network');
setupLogRocketReact(LogRocket);
}
ReactDOM.render(
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>

View File

@ -1,3 +1,4 @@
import LogRocket from 'logrocket';
import { applyMiddleware, compose, createStore } from 'redux';
import { connectRouter, routerMiddleware } from 'connected-react-router';
import createSagaMiddleware from 'redux-saga';
@ -18,6 +19,17 @@ import arbitration from './features/arbitration';
import metadata from './features/metadata';
import approval from './features/approval';
const emptyMiddleWare = store => next => action => {
next(action);
}
function getLogrocket() {
if (!process || !process.env || process.env.NODE_ENV !== 'development') {
return LogRocket.reduxMiddleware();
}
return emptyMiddleWare;
}
const persistConfig = {
key: 'teller-network-store',
storage,
@ -47,7 +59,8 @@ const store = createStore(
composeEnhancers(
applyMiddleware(
routerMiddleware(history),
sagaMiddleware
sagaMiddleware,
getLogrocket()
),
),
);

View File

@ -11886,6 +11886,16 @@ loglevel@^1.4.1:
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa"
integrity sha1-4PyVEztu8nbNyIh82vJKpvFW+Po=
logrocket-react@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/logrocket-react/-/logrocket-react-3.0.0.tgz#b0e1bfa4de25ae89c5da890fbb1c18276a1ac82f"
integrity sha512-vjx2MkFfvKDVilGuHBUuBPyr2en3tvd7bd9rozwEeYELk/DNL5z7Aqoqaz7DLlIhJndOG7/wIv873OdupySiRQ==
logrocket@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/logrocket/-/logrocket-1.0.1.tgz#0555ec619d2db54a7b345c4e8df09baea835b176"
integrity sha512-oPA0c5GzMKsWp/6p19OaujZQMzttluqVOI+989uHeciPAljPZvGEpZRbNO3Rr+jC/8jVLJdlMP9IHuyhKsASGA==
looper@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/looper/-/looper-2.0.0.tgz#66cd0c774af3d4fedac53794f742db56da8f09ec"