From cde949e3a15a89ba6d3ebf267c2c033ecd2b44c0 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 6 Dec 2019 03:48:12 -0800 Subject: [PATCH] Fix double-parsing of process config Summary: This had been there for way too long. Reviewed By: mweststrate Differential Revision: D18834089 fbshipit-source-id: 563aa04876910a7544a7f62865b146b933dbf570 --- src/utils/argvUtils.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/argvUtils.tsx b/src/utils/argvUtils.tsx index d77d3d410..9f14e8cf3 100644 --- a/src/utils/argvUtils.tsx +++ b/src/utils/argvUtils.tsx @@ -9,10 +9,9 @@ import electron from 'electron'; import isProduction from './isProduction'; +import processConfig from './processConfig'; export const isAutoUpdaterEnabled = () => - // TODO(T39788540): Centralise config access and avoid parsing multiple times. - JSON.parse(electron.remote.process.env.CONFIG || process.env.CONFIG || '{}') - .updaterEnabled && + processConfig().updaterEnabled && isProduction() && process.platform === 'darwin';