From e8ed9f290bc45c86aea6053b9e0cb583e5fdc50d Mon Sep 17 00:00:00 2001 From: Ben White Date: Tue, 3 Dec 2024 17:41:59 +0100 Subject: [PATCH] Fixes --- src/web-experiments.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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)) {