1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00

docs: only initialize unleash if config is valid

This commit is contained in:
Thomas Heartman 2023-02-01 10:37:06 +01:00
parent a91089d904
commit b252c07499
No known key found for this signature in database
GPG Key ID: 47CFBB2D87C87664

View File

@ -16,9 +16,11 @@ function Root({ children }) {
appName: `docs.getunleash.io-${customFields.environment}`,
};
const configIsValid = unleashConfig.clientKey && unleashConfig.url;
const [showFeedback, setShowFeedback] = React.useState(false);
if (typeof fetch !== 'undefined') {
if (configIsValid && typeof fetch !== 'undefined') {
try {
const unleash = new UnleashClient(unleashConfig);
unleash.on('ready', () => {