Anastasia Poupeney
7 years ago
11 changed files with 67 additions and 10 deletions
@ -0,0 +1,15 @@ |
|||||
|
// @flow
|
||||
|
|
||||
|
import db from 'helpers/db' |
||||
|
import uuid from 'uuid/v4' |
||||
|
|
||||
|
// a user is an anonymous way to identify a same instance of the app
|
||||
|
|
||||
|
export default () => { |
||||
|
let user = db.get('user') |
||||
|
if (!user) { |
||||
|
user = { id: uuid() } |
||||
|
db.set('user', user) |
||||
|
} |
||||
|
return user |
||||
|
} |
@ -1,7 +1,7 @@ |
|||||
const { SENTRY_URL } = process.env |
const { SENTRY_URL } = process.env |
||||
|
|
||||
if (__PROD__ && SENTRY_URL) { |
if (__PROD__ && SENTRY_URL) { |
||||
const Raven = require('raven') |
// const Raven = require('raven')
|
||||
const ravenConfig = { captureUnhandledRejections: true } |
// const ravenConfig = { captureUnhandledRejections: true }
|
||||
Raven.config(SENTRY_URL, ravenConfig).install() |
// Raven.config(SENTRY_URL, ravenConfig).install()
|
||||
} |
} |
||||
|
@ -0,0 +1,19 @@ |
|||||
|
const Raven = require('raven-js') |
||||
|
require('../env') |
||||
|
|
||||
|
import { sentryLogsBooleanSelector } from 'reducers/settings' |
||||
|
|
||||
|
const { SENTRY_URL } = process.env |
||||
|
|
||||
|
let isSentryInstalled = false |
||||
|
|
||||
|
export default store => next => action => { |
||||
|
next(action) |
||||
|
if (__PROD__ && SENTRY_URL) { |
||||
|
const state = store.getState() |
||||
|
const sentryLogs = sentryLogsBooleanSelector(state) |
||||
|
// if (sentryLogs !== isSentryInstalled) {
|
||||
|
//
|
||||
|
// }
|
||||
|
} |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
const Raven = require('raven-js') |
||||
|
require('../../env') |
||||
|
import user from 'helpers/user' |
||||
|
|
||||
|
const { SENTRY_URL } = process.env |
||||
|
|
||||
|
export default shouldSendCallback => { |
||||
|
Raven.config(SENTRY_URL, { |
||||
|
allowSecretKey: true, |
||||
|
release: __APP_VERSION__, |
||||
|
environment: __DEV__ ? 'development' : 'production', |
||||
|
shouldSendCallback, |
||||
|
}) |
||||
|
.setUserContext({ |
||||
|
ip_address: null, |
||||
|
id: user().id, |
||||
|
}) |
||||
|
.install() |
||||
|
} |
Loading…
Reference in new issue