Skip to content

Commit 594804a

Browse files
authored
Fix default for getFlag. (#334)
1 parent 9a91dad commit 594804a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

vue/sbc-common-components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vue/sbc-common-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sbc-common-components",
3-
"version": "3.0.8",
3+
"version": "3.0.9",
44
"private": false,
55
"description": "Common Vue Components to be used across BC Registries and Online Services.",
66
"license": "Apache-2.0",

vue/sbc-common-components/src/services/launchdarkly.services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ class LaunchDarklyService {
4747
ConfigHelper.addToSession(SessionStorageKeys.LaunchDarklyFlags, JSON.stringify(this.ldClient.allFlags()))
4848
}
4949

50-
public getFlag (flagName: string): any {
50+
public getFlag (flagName: string, defaultValue = null): any {
5151
const ldFlags = JSON.parse(ConfigHelper.getFromSession(SessionStorageKeys.LaunchDarklyFlags) || '{}')
52-
return (this.flags && this.flags[flagName]) || (ldFlags && ldFlags[flagName])
52+
return (this.flags && this.flags[flagName]) || (ldFlags && ldFlags[flagName]) || defaultValue
5353
}
5454
}
5555

0 commit comments

Comments
 (0)