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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0d34662698
commit
8400e6b240
@@ -10,6 +10,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Modal, Button} from 'antd';
|
import {Modal, Button} from 'antd';
|
||||||
import {getFlipperLib, Layout, _NuxManagerContext} from 'flipper-plugin';
|
import {getFlipperLib, Layout, _NuxManagerContext} from 'flipper-plugin';
|
||||||
|
import {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import isProduction from '../utils/isProduction';
|
import isProduction from '../utils/isProduction';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -38,9 +39,13 @@ class PWAWizardTracker {
|
|||||||
|
|
||||||
const tracker = new PWAWizardTracker();
|
const tracker = new PWAWizardTracker();
|
||||||
|
|
||||||
|
function isElectron() {
|
||||||
|
return !getRenderHostInstance().serverConfig.environmentInfo.isHeadlessBuild;
|
||||||
|
}
|
||||||
|
|
||||||
const lastShownTimestampKey = 'flipper-pwa-wizard-last-shown-timestamp';
|
const lastShownTimestampKey = 'flipper-pwa-wizard-last-shown-timestamp';
|
||||||
export function shouldShowPWAInstallationWizard(): boolean {
|
export function shouldShowPWAInstallationWizard(): boolean {
|
||||||
if (!isProduction()) {
|
if (!isProduction() || isElectron()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user