Skip to content

Commit

Permalink
SBERDOMA-104 review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitreee committed Apr 14, 2021
1 parent ee3ee99 commit a4adc7b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/condo/domains/common/utils/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import getConfig from 'next/config'
// refs. to: https://github.com/vercel/next.js/blob/canary/examples/with-sentry/utils/sentry.js
export const initSentry = () => {
const { publicRuntimeConfig } = getConfig()
const { sentryDsn, isProduction } = publicRuntimeConfig
const { sentryDsn } = publicRuntimeConfig

if (sentryDsn) {
const integrations = []
Expand All @@ -30,7 +30,7 @@ export const initSentry = () => {
Sentry.init({
integrations,
dsn: sentryDsn,
enabled: isProduction,
enabled: true,
})
}
}
8 changes: 5 additions & 3 deletions apps/condo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ const { EmptyApp } = require('@core/keystone/test.utils')
const { prepareDefaultKeystoneConfig } = require('@core/keystone/setup.utils')
const { registerSchemas } = require('@core/keystone/schema')

require('dd-trace').init({
logInjection: true,
})
if (conf.NODE_ENV === 'production') {
require('dd-trace').init({
logInjection: true,
})
}

const keystone = new Keystone({
...prepareDefaultKeystoneConfig(conf),
Expand Down
4 changes: 1 addition & 3 deletions apps/condo/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ const apolloGraphQLUrl = `${serverUrl}/admin/api`
const firebaseConfig = conf['FIREBASE_CONFIG'] && JSON.parse(conf['FIREBASE_CONFIG'])
const addressSuggestionsConfig = conf['ADDRESS_SUGGESTIONS_CONFIG'] && JSON.parse(conf['ADDRESS_SUGGESTIONS_CONFIG'])
const sentryDsn = conf['SENTRY_DSN']
const isProduction = conf['NODE_ENV'] === 'production'
const mapApiKey = conf['MAP_API_KEY']

module.exports = withSourceMaps(withTM(withLess(withCSS({
publicRuntimeConfig: {
// Will be available on both server and client
sentryDsn,
serverUrl,
isProduction,
firebaseConfig,
apolloGraphQLUrl,
addressSuggestionsConfig,
Expand All @@ -38,7 +36,7 @@ module.exports = withSourceMaps(withTM(withLess(withCSS({
config.resolve.alias['@sentry/node'] = '@sentry/browser'
}

if (sentryDsn && isProduction) {
if (sentryDsn && conf['ENABLE_SENTRY_SOURCEMAPS_UPLOADING'] === 'true') {
config.plugins.push(
new SentryWebpackPlugin({
include: '.next',
Expand Down

0 comments on commit a4adc7b

Please sign in to comment.