Utility to determine if client is PWA
Summary: This is currently used in multiple places, let's put it under utils. Reviewed By: aigoncharov Differential Revision: D50883125 fbshipit-source-id: ee161a035cd01ca73a2521f813c4b397aa647037
This commit is contained in:
committed by
Facebook GitHub Bot
parent
368dfc90f6
commit
08e742ceff
@@ -12,3 +12,5 @@ export {RenderHost, getRenderHostInstance} from 'flipper-frontend-core';
|
|||||||
export {startFlipperDesktop} from './startFlipperDesktop';
|
export {startFlipperDesktop} from './startFlipperDesktop';
|
||||||
|
|
||||||
export {Icon} from './utils/icons';
|
export {Icon} from './utils/icons';
|
||||||
|
|
||||||
|
export {isPWA} from './utils/pwa';
|
||||||
|
|||||||
12
desktop/flipper-ui-core/src/utils/pwa.tsx
Normal file
12
desktop/flipper-ui-core/src/utils/pwa.tsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const isPWA = () => {
|
||||||
|
return window.matchMedia('(display-mode: standalone)').matches;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user