Skip to content

Commit 96099f4

Browse files
committed
fix: wrong variable access.
1 parent ce471fa commit 96099f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/flags.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ const flagsRaw = (env.PUBLIC_CONSOLE_FEATURE_FLAGS ?? '').split(',');
77

88
function isFlagEnabled(name: string) {
99
// loose generic to allow safe access while retaining type safety
10-
return <T extends { user?: Account; organization?: Organization }>(data: T) => {
11-
const { user, organization } = data;
10+
return <T extends { account?: Account; organization?: Organization }>(data: T) => {
11+
const { account, organization } = data;
1212

1313
return !!(
1414
flagsRaw.includes(name) ||
15-
user?.prefs?.[`flags-${name}`] ||
15+
account?.prefs?.[`flags-${name}`] ||
1616
organization?.prefs?.[`flags-${name}`]
1717
);
1818
};

0 commit comments

Comments
 (0)