import React from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter as Router } from 'react-router-dom'
import { Provider } from 'react-redux'
import * as Sentry from '@sentry/react'

import * as serviceWorker from './serviceWorker'
import App from './App'
import configureStore from './redux/configureStore'

const store = configureStore()

if (process.env.NODE_ENV === 'production') {
	const state = store.getState()
	Sentry.init({
		dsn:
			'https://2c14c1a4ae774cdd9c80545e7a34c2e7@o55905.ingest.sentry.io/1246393',
	})

	Sentry.configureScope(scope => {
		scope.setUser({
			id: state.user.id,
			username: state.user.name,
		})
	})
}

ReactDOM.render(
	<Provider store={store}>
		<Router>
			<App />
		</Router>
	</Provider>,
	document.getElementById('root')
)

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
serviceWorker.unregister()

@@ -447,20 +447,17 @@
 %7B%0A%09%09dsn:
-%0A%09%09%09
+ 
 'https:/
@@ -990,18 +990,16 @@
 eWorker.
-un
 register

enable service worker