From 8400e6b24066940a50bc06ee6b685d95700c688a Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Thu, 18 May 2023 06:29:00 -0700 Subject: [PATCH] Don't ask to install PWA if running as Electron Summary: I had wrongly assumed the display mode was standalone for Electron, but it turns out that is not the case. So, explicitly prevent showing the wizard in Electron builds. Reviewed By: antonk52 Differential Revision: D45983295 fbshipit-source-id: 0bd770d28c0e52a7417789751ac78c5f84165d86 --- .../flipper-ui-core/src/chrome/PWAppInstallationWizard.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-ui-core/src/chrome/PWAppInstallationWizard.tsx b/desktop/flipper-ui-core/src/chrome/PWAppInstallationWizard.tsx index 4179af89a..ff1b2a66d 100644 --- a/desktop/flipper-ui-core/src/chrome/PWAppInstallationWizard.tsx +++ b/desktop/flipper-ui-core/src/chrome/PWAppInstallationWizard.tsx @@ -10,6 +10,7 @@ import React from 'react'; import {Modal, Button} from 'antd'; import {getFlipperLib, Layout, _NuxManagerContext} from 'flipper-plugin'; +import {getRenderHostInstance} from 'flipper-frontend-core'; import isProduction from '../utils/isProduction'; type Props = { @@ -38,9 +39,13 @@ class PWAWizardTracker { const tracker = new PWAWizardTracker(); +function isElectron() { + return !getRenderHostInstance().serverConfig.environmentInfo.isHeadlessBuild; +} + const lastShownTimestampKey = 'flipper-pwa-wizard-last-shown-timestamp'; export function shouldShowPWAInstallationWizard(): boolean { - if (!isProduction()) { + if (!isProduction() || isElectron()) { return false; }