Skip to content

Commit

Permalink
Update to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiuhc committed Dec 1, 2023
1 parent 8f2aed2 commit 4504054
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/experiment-browser/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export interface ExperimentConfig {
| **instanceName** | `$default_instance` |
| **fallbackVariant** | `null` |
| **initialVariants** | `null` |
| **initialFlags** | `null` |
| **initialFlags** | `undefined` |
| **source** | `Source.LocalStorage` |
| **serverUrl** | `"https://api.lab.amplitude.com"` |
| **flagsServerUrl** | `"https://flag.lab.amplitude.com"` |
Expand All @@ -173,7 +173,7 @@ export const Defaults: ExperimentConfig = {
instanceName: '$default_instance',
fallbackVariant: {},
initialVariants: {},
initialFlags: null,
initialFlags: undefined,
source: Source.LocalStorage,
serverUrl: 'https://api.lab.amplitude.com',
flagsServerUrl: 'https://flag.lab.amplitude.com',
Expand Down
6 changes: 3 additions & 3 deletions packages/experiment-browser/src/experimentClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ export class ExperimentClient implements Client {
private mergeInitialFlagsWithStorage(): void {
if (this.config.initialFlags) {
const initialFlags = JSON.parse(this.config.initialFlags);
for (const key in initialFlags) {
if (!this.flags.get(initialFlags[key].key)) {
this.flags.put(initialFlags[key].key, initialFlags[key]);
for (const flag of initialFlags) {
if (!this.flags.get(flag.key)) {
this.flags.put(flag.key, flag);
}
}
}
Expand Down

0 comments on commit 4504054

Please sign in to comment.