From a41df015db7324366a58d04aef33b29785111546 Mon Sep 17 00:00:00 2001 From: Hanbyul Jo Date: Wed, 27 Sep 2023 11:51:35 -0400 Subject: [PATCH] Remove error log from production --- app/scripts/components/analysis/results/use-analysis-params.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/components/analysis/results/use-analysis-params.ts b/app/scripts/components/analysis/results/use-analysis-params.ts index 4877578ab..f6c91d21c 100644 --- a/app/scripts/components/analysis/results/use-analysis-params.ts +++ b/app/scripts/components/analysis/results/use-analysis-params.ts @@ -32,6 +32,7 @@ const initialState: AnalysisParamsNull = { errors: null }; +const LOG = process.env.NODE_ENV !== 'production'; export class ValidationError extends Error { hints: any[]; @@ -125,7 +126,7 @@ export function useAnalysisParams(): { } catch (error) { if (error instanceof ValidationError) { /* eslint-disable no-console */ - error.hints.forEach((s) => console.log(s)); + if (LOG) error.hints.forEach((s) => console.log(s)); /* eslint-enable no-console */ setParams({ ...initialState,