From 359392a44c968532ca96834f64558367c2fe43cb Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Fri, 11 Aug 2023 10:56:38 -0700 Subject: [PATCH] Match isProduction definitions Summary: Match isProduction definition in flipper-common and flipper-server/src/index.tsx. Without it, PWA never quits after all clients disconnect because Flipper Launcher does not set NODE_ENV to production currently (changed in the next diff) Reviewed By: LukeDefeo, lblasa Differential Revision: D48265768 fbshipit-source-id: 59e4660cb57da20b606562144c47c65276999d6c --- desktop/flipper-common/src/utils/isProduction.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-common/src/utils/isProduction.tsx b/desktop/flipper-common/src/utils/isProduction.tsx index 0fe3e17e8..d2b1c556f 100644 --- a/desktop/flipper-common/src/utils/isProduction.tsx +++ b/desktop/flipper-common/src/utils/isProduction.tsx @@ -13,6 +13,7 @@ declare const process: any; // this one, and one provided by the RenderHostConfig. Ideally they should be unified export function isProduction(): boolean { return ( - typeof process === 'undefined' || process.env.NODE_ENV === 'production' + typeof process === 'undefined' || + (process.env.NODE_ENV !== 'development' && process.env.NODE_ENV !== 'test') ); }