Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Dec 3, 2024
1 parent 6a14322 commit e8ed9f2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/web-experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, WebExperiment>()
// 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)) {
Expand Down

0 comments on commit e8ed9f2

Please sign in to comment.