Skip to content

Commit 1312964

Browse files
committed
Set only hashedEmailUserIdentityType and not configsettings on rokt manager
1 parent bd7785f commit 1312964

2 files changed

Lines changed: 8 additions & 18 deletions

File tree

src/roktManager.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default class RoktManager {
9999
private launcherOptions?: IRoktLauncherOptions;
100100
private logger: SDKLoggerApi;
101101
private domain?: string;
102-
private configSettings: Dictionary<string> = {};
102+
private hashedEmailUserIdentityType?: string | null;
103103
/**
104104
* Initializes the RoktManager with configuration settings and user data.
105105
*
@@ -120,8 +120,8 @@ export default class RoktManager {
120120
options?: IRoktOptions
121121
): void {
122122
const { userAttributeFilters, settings } = roktConfig || {};
123-
const { placementAttributesMapping } = settings || {};
124-
this.configSettings = settings;
123+
const { placementAttributesMapping, configSettings } = settings || {};
124+
this.hashedEmailUserIdentityType = configSettings?.hashedEmailUserIdentityType;
125125

126126
this.identityService = identityService;
127127
this.store = store;
@@ -183,9 +183,8 @@ export default class RoktManager {
183183
const { attributes } = options;
184184
const sandboxValue = attributes?.sandbox || null;
185185
const mappedAttributes = this.mapPlacementAttributes(attributes, this.placementAttributesMapping);
186-
const { hashedEmailUserIdentityType = null } = this.configSettings || {};
187186

188-
const normalizedHashedEmailUserIdentityType = hashedEmailUserIdentityType?.toLowerCase() || null;
187+
const normalizedHashedEmailUserIdentityType = this.hashedEmailUserIdentityType?.toLowerCase() || null;
189188

190189
// Get current user identities
191190
this.currentUser = this.identityService.getCurrentUser();

test/jest/roktManager.spec.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,6 @@ describe('RoktManager', () => {
998998
};
999999

10001000
roktManager['placementAttributesMapping'] = [];
1001-
roktManager['configSettings'] = {};
10021001
roktManager.kit = kit as IRoktKit;
10031002

10041003
const mockIdentity = {
@@ -1044,9 +1043,7 @@ describe('RoktManager', () => {
10441043
};
10451044

10461045
roktManager.kit = kit as IRoktKit;
1047-
roktManager['configSettings'] = {
1048-
hashedEmailUserIdentityType: 'Other5'
1049-
};
1046+
roktManager['hashedEmailUserIdentityType'] ='Other5';
10501047

10511048
// Set up fresh mocks for this test
10521049
const mockIdentity = {
@@ -1100,9 +1097,7 @@ describe('RoktManager', () => {
11001097
};
11011098

11021099
roktManager.kit = kit as IRoktKit;
1103-
roktManager['configSettings'] = {
1104-
hashedEmailUserIdentityType: 'Other5'
1105-
};
1100+
roktManager['hashedEmailUserIdentityType'] = 'Other5';
11061101

11071102
// Set up fresh mocks for this test
11081103
const mockIdentity = {
@@ -1144,9 +1139,7 @@ describe('RoktManager', () => {
11441139
};
11451140

11461141
roktManager.kit = kit as IRoktKit;
1147-
roktManager['configSettings'] = {
1148-
hashedEmailUserIdentityType: 'Other'
1149-
};
1142+
roktManager['hashedEmailUserIdentityType'] = 'Other';
11501143

11511144
const mockIdentity = {
11521145
getCurrentUser: jest.fn().mockReturnValue({
@@ -1197,9 +1190,7 @@ describe('RoktManager', () => {
11971190
};
11981191

11991192
roktManager.kit = kit as IRoktKit;
1200-
roktManager['configSettings'] = {
1201-
hashedEmailUserIdentityType: 'Other'
1202-
};
1193+
roktManager['hashedEmailUserIdentityType'] = 'Other';
12031194

12041195
// Set up fresh mocks for this test
12051196
const mockIdentity = {

0 commit comments

Comments
 (0)