diff --git a/src/web-experiments.ts b/src/web-experiments.ts index 6e2476d14..244b10bfe 100644 --- a/src/web-experiments.ts +++ b/src/web-experiments.ts @@ -43,19 +43,18 @@ export class WebExperiments { return } - if (!this._flagToExperiments) { + if (this.instance.config.disable_web_experiments) { + return + } + + if (isNullish(this._flagToExperiments)) { // Indicates first load so we trigger the loaders this._flagToExperiments = new Map() - // NOTE: Should this only fire once? this.loadIfEnabled() this.previewWebExperiment() return } - if (isNullish(this._flagToExperiments) || this.instance.config.disable_web_experiments) { - return - } - WebExperiments.logInfo('applying feature flags', flags) flags.forEach((flag) => { if (this._flagToExperiments && this._flagToExperiments?.has(flag)) {