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

@@ -18,6 +18,11 @@
theme: 'light',
entryPoint: 'flipper-ui-browser/src/index-fast-refresh.bundle?platform=web&dev=true&minify=false',
debug: true,
GRAPH_SECRET: 'GRAPH_SECRET_REPLACE_ME',
FLIPPER_APP_VERSION: 'FLIPPER_APP_VERSION_REPLACE_ME',
FLIPPER_SESSION_ID: 'FLIPPER_SESSION_ID_REPLACE_ME',
FLIPPER_UNIXNAME: 'FLIPPER_UNIXNAME_REPLACE_ME',
FLIPPER_AUTH_TOKEN: 'FLIPPER_AUTH_TOKEN_REPLACE_ME',
}
</script>
<style>
@@ -155,16 +160,10 @@
window.flipperShowMessage = showMessage;
window.flipperHideMessage = hideMessage;
window.GRAPH_SECRET = 'GRAPH_SECRET_REPLACE_ME';
window.FLIPPER_APP_VERSION = 'FLIPPER_APP_VERSION_REPLACE_ME';
window.FLIPPER_SESSION_ID = 'FLIPPER_SESSION_ID_REPLACE_ME';
window.FLIPPER_UNIXNAME = 'FLIPPER_UNIXNAME_REPLACE_ME';
window.FLIPPER_AUTH_TOKEN = 'FLIPPER_AUTH_TOKEN_REPLACE_ME';
const params = new URL(location.href).searchParams;
let token = params.get('token');
if (!token) {
token = window.FLIPPER_AUTH_TOKEN
token = window.flipperConfig.FLIPPER_AUTH_TOKEN
}
const socket = new WebSocket(`ws://${location.host}?token=${token}`);