aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-22 02:25:10 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-22 02:25:10 +0800
commite2a16f3f336c6787501c6a2366e7793a135009f8 (patch)
treea4ecb9d821cbb986a425136f3a2ead3ee4acfd85 /packages/instant/src
parent70c99082496bbaed5b5ccc37bb259c0a9f02fab5 (diff)
downloaddexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.gz
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.bz2
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.lz
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.xz
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.zst
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.zip
Use ROLLBAR_ENABLED constant, and change ROLLBAR_ENVIRONMENT to INSTANT_ENVIRONMENT
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/constants.ts3
-rw-r--r--packages/instant/src/util/error_reporter.ts13
2 files changed, 5 insertions, 11 deletions
diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts
index 23660360d..dfa7520f8 100644
--- a/packages/instant/src/constants.ts
+++ b/packages/instant/src/constants.ts
@@ -21,12 +21,13 @@ export const COINBASE_API_BASE_URL = 'https://api.coinbase.com/v2';
export const PROGRESS_STALL_AT_WIDTH = '95%';
export const PROGRESS_FINISH_ANIMATION_TIME_MS = 200;
export const ROLLBAR_CLIENT_TOKEN = process.env.ROLLBAR_CLIENT_TOKEN;
-export const ROLLBAR_ENVIRONMENT = process.env.ROLLBAR_ENVIRONMENT as
+export const INSTANT_ENVIRONMENT = process.env.INSTANT_ENVIRONMENT as
| 'dogfood'
| 'staging'
| 'development'
| 'production'
| undefined;
+export const ROLLBAR_ENABLED = process.env.ROLLBAR_ENABLED;
export const COINBASE_WALLET_IOS_APP_STORE_URL = 'https://itunes.apple.com/us/app/coinbase-wallet/id1278383455?mt=8';
export const COINBASE_WALLET_ANDROID_APP_STORE_URL = 'https://play.google.com/store/apps/details?id=org.toshi&hl=en';
export const COINBASE_WALLET_SITE_URL = 'https://wallet.coinbase.com/';
diff --git a/packages/instant/src/util/error_reporter.ts b/packages/instant/src/util/error_reporter.ts
index c5766b469..89c5b6bd3 100644
--- a/packages/instant/src/util/error_reporter.ts
+++ b/packages/instant/src/util/error_reporter.ts
@@ -1,24 +1,17 @@
import { logUtils } from '@0x/utils';
import * as _ from 'lodash';
-import { ROLLBAR_CLIENT_TOKEN, ROLLBAR_ENVIRONMENT } from '../constants';
+import { INSTANT_ENVIRONMENT, ROLLBAR_CLIENT_TOKEN, ROLLBAR_ENABLED } from '../constants';
// Import version of Rollbar designed for embedded components
// See https://docs.rollbar.com/docs/using-rollbarjs-inside-an-embedded-component
// tslint:disable-next-line:no-var-requires
const Rollbar = require('rollbar/dist/rollbar.noconflict.umd');
-const shouldAllowRollbar = () => {
- if (ROLLBAR_ENVIRONMENT === 'development') {
- return process.env.ROLLBAR_FORCE_DEVELOPMENT_REPORT ? true : false;
- }
- return true;
-};
-
let rollbar: any;
// Configures rollbar and sets up error catching
export const setupRollbar = (): any => {
- if (_.isUndefined(rollbar) && ROLLBAR_CLIENT_TOKEN && ROLLBAR_ENVIRONMENT && shouldAllowRollbar()) {
+ if (_.isUndefined(rollbar) && ROLLBAR_CLIENT_TOKEN && INSTANT_ENVIRONMENT && ROLLBAR_ENABLED) {
rollbar = new Rollbar({
accessToken: ROLLBAR_CLIENT_TOKEN,
captureUncaught: true,
@@ -27,7 +20,7 @@ export const setupRollbar = (): any => {
itemsPerMinute: 10,
maxItems: 500,
payload: {
- environment: ROLLBAR_ENVIRONMENT,
+ environment: INSTANT_ENVIRONMENT,
client: {
javascript: {
source_map_enabled: true,