Skip to content

Commit 4a3482d

Browse files
shared consent handler
1 parent 40db3ee commit 4a3482d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/utils/src/web/session/sessionStart.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ export function sessionStart(
2828

2929
// Consent
3030
if (consent) {
31+
const consentHandler = onConsentFn(config, cb);
32+
3133
const consentConfig = (
3234
isArray(consent) ? consent : [consent]
3335
).reduce<WalkerOS.AnyObject>(
34-
(acc, key) => ({ ...acc, [key]: onConsentFn(config, cb) }),
36+
(acc, key) => ({ ...acc, [key]: consentHandler }),
3537
{},
3638
);
3739
elb('walker on', 'consent', consentConfig);

0 commit comments

Comments
 (0)