Skip to content

Commit d09a338

Browse files
author
Athira M
committed
Merge branch 'web-experiment' into web-exp-ga
2 parents 27cb4b2 + 17126e9 commit d09a338

File tree

1 file changed

+6
-5
lines changed
  • packages/remote-config/src

1 file changed

+6
-5
lines changed

packages/remote-config/src/api.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,18 @@ export async function activate(remoteConfig: RemoteConfig): Promise<boolean> {
112112
return false;
113113
}
114114
const experiment = new Experiment(rc._storage, rc._analyticsProvider);
115+
const updateActiveExperiments = lastSuccessfulFetchResponse.experiments
116+
? experiment.updateActiveExperiments(
117+
lastSuccessfulFetchResponse.experiments
118+
)
119+
: Promise.resolve();
115120
await Promise.all([
116121
rc._storageCache.setActiveConfig(lastSuccessfulFetchResponse.config),
117122
rc._storage.setActiveConfigEtag(lastSuccessfulFetchResponse.eTag),
118123
rc._storage.setActiveConfigTemplateVersion(
119124
lastSuccessfulFetchResponse.templateVersion
120125
),
121-
lastSuccessfulFetchResponse.experiments &&
122-
experiment.updateActiveExperiments(
123-
lastSuccessfulFetchResponse.experiments
124-
),
125-
rc._storage.setActiveConfigEtag(lastSuccessfulFetchResponse.eTag)
126+
updateActiveExperiments
126127
]);
127128
return true;
128129
}

0 commit comments

Comments
 (0)