Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 27d701d

Browse files
author
Aaron
authored
Merge pull request #2656 from mehrzad-fs/bot-error-disable-track
Mehrzad / track error if isProduction
2 parents bcd681c + 8e552cf commit 27d701d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/botPage/view/blockly/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { getLanguage } from '../../../common/lang';
2626
import { observer as globalObserver } from '../../../common/utils/observer';
2727
import { showDialog } from '../../bot/tools';
2828
import GTM from '../../../common/gtm';
29-
import { parseQueryString } from '../../../common/utils/tools';
29+
import { parseQueryString, isProduction } from '../../../common/utils/tools';
3030
import { TrackJSError } from '../logger';
3131
import config from '../../common/const';
3232

@@ -56,7 +56,7 @@ const disposeBlocksWithLoaders = () => {
5656

5757
const marketsWereRemoved = xml => {
5858
if (!Array.from(xml.children).every(block => !removeUnavailableMarkets(block))) {
59-
if (window.trackJs) {
59+
if (window.trackJs && isProduction()) {
6060
trackJs.track('Invalid financial market');
6161
}
6262
showDialog({

src/botPage/view/logger.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { observer as globalObserver } from '../../common/utils/observer';
22
import { getToken } from '../../common/utils/storageManager';
3+
import { isProduction } from '../../common/utils/tools';
34

45
const log = (type, ...args) => {
56
if (type === 'warn') {
@@ -66,7 +67,7 @@ const notifyError = error => {
6667

6768
notify({ className: 'error', message, position: 'right' });
6869

69-
if (trackJs) {
70+
if (trackJs && isProduction()) {
7071
trackJs.console.log(error);
7172
trackJs.track(code || error.name);
7273
}

src/common/integrations/GoogleDrive.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* global google,gapi */
22
import { getLanguage } from '../lang';
33
import { observer as globalObserver } from '../utils/observer';
4-
import { translate } from '../utils/tools';
4+
import { translate, isProduction } from '../utils/tools';
55
import config from '../../botPage/common/const';
66
import { load } from '../../botPage/view/blockly';
77
import { TrackJSError } from '../../botPage/view/logger';
@@ -42,7 +42,7 @@ class GoogleDrive {
4242
.removeClass('invisible');
4343
},
4444
error => {
45-
if (window.trackJs) {
45+
if (window.trackJs && isProduction()) {
4646
trackJs.track(
4747
`${translate(
4848
'There was an error initialising Google Drive'
@@ -53,7 +53,7 @@ class GoogleDrive {
5353
);
5454
},
5555
onerror: error => {
56-
if (window.trackJs) {
56+
if (window.trackJs && isProduction()) {
5757
trackJs.track(
5858
`${translate('There was an error loading Google Drive libraries')} - Error: ${JSON.stringify(
5959
error

0 commit comments

Comments
 (0)