Move constants to flipperConfig

Summary: Recently we have added a few constants to be used by our main entry point. This change moves them to a central place: flipperConfig.

Reviewed By: aigoncharov

Differential Revision: D51307088

fbshipit-source-id: 09f0ef0e69e2067ce5c8501367629eeec7523858
This commit is contained in:
Lorenzo Blasa
2023-11-14 10:53:09 -08:00
committed by Facebook GitHub Bot
parent 0889a0e02d
commit 49abb4dd41
4 changed files with 17 additions and 19 deletions

View File

@@ -17,12 +17,12 @@ declare global {
theme: 'light' | 'dark' | 'system';
entryPoint: string;
debug: boolean;
GRAPH_SECRET: string;
FLIPPER_APP_VERSION: string;
FLIPPER_SESSION_ID: string;
FLIPPER_UNIXNAME: string;
FLIPPER_AUTH_TOKEN: string;
};
GRAPH_SECRET: string;
FLIPPER_APP_VERSION: string;
FLIPPER_SESSION_ID: string;
FLIPPER_UNIXNAME: string;
FLIPPER_AUTH_TOKEN: string;
flipperShowMessage?(message: {title?: string; detail?: string}): void;
flipperHideMessage?(): void;

View File

@@ -56,7 +56,7 @@ async function start() {
let token = providerParams.get('token');
if (!token) {
console.info('[flipper-client][ui-browser] Get token from HTML instead');
token = window.FLIPPER_AUTH_TOKEN;
token = window.flipperConfig.FLIPPER_AUTH_TOKEN;
if (!token || token === 'FLIPPER_AUTH_TOKEN_REPLACE_ME') {
console.warn(
'[flipper-client][ui-browser] Failed to get token from HTML',