From b292ecec71f115f1d0cc3dde02f6feb2007006f1 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 9 Aug 2019 10:32:36 -0700 Subject: [PATCH] Migrate argvUtils Summary: _typescript_ Quite happy that the stupid check for `remote` can finally go away. Reviewed By: jknoxville Differential Revision: D16709217 fbshipit-source-id: 94bc035d2a7bbc3131e35febd48723760841f6b4 --- src/chrome/TitleBar.tsx | 2 +- src/utils/{argvUtils.js => argvUtils.tsx} | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) rename src/utils/{argvUtils.js => argvUtils.tsx} (78%) diff --git a/src/chrome/TitleBar.tsx b/src/chrome/TitleBar.tsx index 7cdcc5b72..3421dd9c3 100644 --- a/src/chrome/TitleBar.tsx +++ b/src/chrome/TitleBar.tsx @@ -32,7 +32,7 @@ import ScreenCaptureButtons from './ScreenCaptureButtons.js'; import AutoUpdateVersion from './AutoUpdateVersion'; import UpdateIndicator from './UpdateIndicator'; import config from '../fb-stubs/config'; -import {isAutoUpdaterEnabled} from '../utils/argvUtils.js'; +import {isAutoUpdaterEnabled} from '../utils/argvUtils'; import isProduction from '../utils/isProduction.js'; import {clipboard} from 'electron'; import React from 'react'; diff --git a/src/utils/argvUtils.js b/src/utils/argvUtils.tsx similarity index 78% rename from src/utils/argvUtils.js rename to src/utils/argvUtils.tsx index 542c85391..7fd27f0be 100644 --- a/src/utils/argvUtils.js +++ b/src/utils/argvUtils.tsx @@ -10,8 +10,7 @@ import isProduction from './isProduction'; export const isAutoUpdaterEnabled = () => // TODO(T39788540): Centralise config access and avoid parsing multiple times. - // $FlowFixMe: env is not in the type defs. - JSON.parse(electron.remote?.process.env.CONFIG || process.env.CONFIG || '{}') + JSON.parse(electron.remote.process.env.CONFIG || process.env.CONFIG || '{}') .updaterEnabled && isProduction() && process.platform === 'darwin';