Back out "Use isPWA utility function instead"
Summary:
Original commit changeset: 6bc0c942b3d9
Original Phabricator Diff: D50885337
There's an issue with the import, same reason we do:
```
require('flipper-ui-core').startFlipperDesktop(flipperServer);
```
Reviewed By: aigoncharov
Differential Revision: D50926125
fbshipit-source-id: 04e1b920bcecab9f245924907637b36dac312f1f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e72dcbb28d
commit
fecaa8d974
@@ -15,7 +15,6 @@ import {
|
|||||||
import {init as initLogger} from './fb-stubs/Logger';
|
import {init as initLogger} from './fb-stubs/Logger';
|
||||||
import {initializeRenderHost} from './initializeRenderHost';
|
import {initializeRenderHost} from './initializeRenderHost';
|
||||||
import {createFlipperServer, FlipperServerState} from 'flipper-server-client';
|
import {createFlipperServer, FlipperServerState} from 'flipper-server-client';
|
||||||
import {isPWA} from 'flipper-ui-core';
|
|
||||||
|
|
||||||
const loadingContainer = document.getElementById('loading');
|
const loadingContainer = document.getElementById('loading');
|
||||||
if (loadingContainer) {
|
if (loadingContainer) {
|
||||||
@@ -168,7 +167,7 @@ start().catch((e) => {
|
|||||||
logger.track('success-rate', 'flipper-ui-browser-started', {
|
logger.track('success-rate', 'flipper-ui-browser-started', {
|
||||||
value: 0,
|
value: 0,
|
||||||
error: getStringFromErrorLike(e),
|
error: getStringFromErrorLike(e),
|
||||||
pwa: isPWA(),
|
pwa: window.matchMedia('(display-mode: standalone)').matches,
|
||||||
});
|
});
|
||||||
window.flipperShowMessage?.('Failed to start UI with error: ' + e);
|
window.flipperShowMessage?.('Failed to start UI with error: ' + e);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {Image, 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 {getRenderHostInstance} from 'flipper-frontend-core';
|
||||||
import isProduction from '../utils/isProduction';
|
import isProduction from '../utils/isProduction';
|
||||||
import {isPWA} from '../utils/pwa';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onHide: () => void;
|
onHide: () => void;
|
||||||
@@ -56,7 +55,7 @@ export function shouldShowPWAInstallationWizard(): boolean {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPWA()) {
|
if (window.matchMedia('(display-mode: standalone)').matches) {
|
||||||
tracker.track('pwa-installation-wizard-should-show', {
|
tracker.track('pwa-installation-wizard-should-show', {
|
||||||
show: false,
|
show: false,
|
||||||
reason: 'Display mode is standalone, seems is already running as PWA',
|
reason: 'Display mode is standalone, seems is already running as PWA',
|
||||||
|
|||||||
Reference in New Issue
Block a user