You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/frontend/src/Store/Middleware/middlewares.js

43 lines
1015 B

import { applyMiddleware, compose } from 'redux';
7 years ago
import Raven from 'raven-js';
import createRavenMiddleware from 'raven-for-redux';
import thunk from 'redux-thunk';
import { routerMiddleware } from 'react-router-redux';
import persistState from './persistState';
export default function(history) {
const {
analytics,
branch,
version,
release,
isProduction
} = window.Sonarr;
7 years ago
const dsn = isProduction ? 'https://c3a5b33e08de4e18b7d0505e942dbc95@sentry.io/216290' :
'https://c3a5b33e08de4e18b7d0505e942dbc95@sentry.io/216290';
Raven.config(dsn).install();
const middlewares = [];
if (analytics) {
7 years ago
middlewares.push(createRavenMiddleware(Raven, {
environment: isProduction ? 'production' : 'development',
release,
tags: {
branch,
version
}
}));
}
middlewares.push(routerMiddleware(history));
middlewares.push(thunk);
return compose(
applyMiddleware(...middlewares),
persistState
);
}