1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-10 17:53:36 +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}`, appName: `docs.getunleash.io-${customFields.environment}`,
}; };
const configIsValid = unleashConfig.clientKey && unleashConfig.url;
const [showFeedback, setShowFeedback] = React.useState(false); const [showFeedback, setShowFeedback] = React.useState(false);
if (typeof fetch !== 'undefined') { if (configIsValid && typeof fetch !== 'undefined') {
try { try {
const unleash = new UnleashClient(unleashConfig); const unleash = new UnleashClient(unleashConfig);
unleash.on('ready', () => { unleash.on('ready', () => {