Skip to content

Commit ed6bf0e

Browse files
committed
Incorporate comments
1 parent 85ed715 commit ed6bf0e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/optimizely-sdk/lib/core/optimizely_config/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ export class OptimizelyConfig {
4747
this.revision = configObj.revision;
4848
this.datafile = datafile;
4949

50-
if (configObj.sdkKey) {
50+
if (configObj.sdkKey && configObj.environmentKey) {
5151
this.sdkKey = configObj.sdkKey;
52-
}
53-
if (configObj.environmentKey) {
5452
this.environmentKey = configObj.environmentKey;
5553
}
5654
}

packages/optimizely-sdk/lib/core/project_config/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ function createMutationSafeDatafileCopy(datafile: any): ProjectConfig {
119119
return rolloutCopy;
120120
});
121121

122-
if (datafile.environmentKey) {
122+
if (datafile.environmentKey && datafile.sdkKey) {
123123
datafileCopy.environmentKey = datafile.environmentKey;
124-
}
125-
if (datafile.sdkKey) {
126124
datafileCopy.sdkKey = datafile.sdkKey;
127125
}
128126

0 commit comments

Comments
 (0)