Skip to content

Commit c232cc3

Browse files
chore(build): Generate latest bundle [skip ci]
1 parent 548cb81 commit c232cc3

File tree

2 files changed

+38
-18
lines changed

2 files changed

+38
-18
lines changed

dist/Rokt-Kit.common.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@ var constructor = function () {
159159
return replaceOtherWithEmailsha256(userIdentities);
160160
}
161161

162+
function returnLocalSessionAttributes() {
163+
if (
164+
isEmpty(self.placementEventMappingLookup) ||
165+
!window.mParticle.Rokt ||
166+
typeof window.mParticle.Rokt.getLocalSessionAttributes !==
167+
'function'
168+
) {
169+
return {};
170+
}
171+
return window.mParticle.Rokt.getLocalSessionAttributes();
172+
}
173+
162174
function replaceOtherWithEmailsha256(_data) {
163175
var data = mergeObjects({}, _data || {});
164176
if (_data.hasOwnProperty(OTHER_IDENTITY)) {
@@ -215,14 +227,7 @@ var constructor = function () {
215227

216228
var filteredUserIdentities = returnUserIdentities(filteredUser);
217229

218-
var localSessionAttributes = {};
219-
220-
try {
221-
localSessionAttributes =
222-
window.mParticle.Rokt.getLocalSessionAttributes();
223-
} catch (error) {
224-
console.error('Error getting local session attributes:', error);
225-
}
230+
var localSessionAttributes = returnLocalSessionAttributes();
226231

227232
var selectPlacementsAttributes = mergeObjects(
228233
filteredUserIdentities,
@@ -260,6 +265,7 @@ var constructor = function () {
260265
function processEvent(event) {
261266
if (
262267
!isKitReady() ||
268+
isEmpty(self.placementEventMappingLookup) ||
263269
typeof window.mParticle.Rokt.setLocalSessionAttribute !== 'function'
264270
) {
265271
return;
@@ -396,7 +402,7 @@ var constructor = function () {
396402

397403
function generateIntegrationName(customIntegrationName) {
398404
var coreSdkVersion = window.mParticle.getVersion();
399-
var kitVersion = "1.7.1";
405+
var kitVersion = "1.7.2";
400406
var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion;
401407

402408
if (customIntegrationName) {
@@ -498,6 +504,10 @@ function hashEventMessage(messageType, eventType, eventName) {
498504
);
499505
}
500506

507+
function isEmpty(value) {
508+
return value == null || !(Object.keys(value) || value).length;
509+
}
510+
501511
if (window && window.mParticle && window.mParticle.addForwarder) {
502512
window.mParticle.addForwarder({
503513
name: name,

dist/Rokt-Kit.iife.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ var RoktKit = (function (exports) {
158158
return replaceOtherWithEmailsha256(userIdentities);
159159
}
160160

161+
function returnLocalSessionAttributes() {
162+
if (
163+
isEmpty(self.placementEventMappingLookup) ||
164+
!window.mParticle.Rokt ||
165+
typeof window.mParticle.Rokt.getLocalSessionAttributes !==
166+
'function'
167+
) {
168+
return {};
169+
}
170+
return window.mParticle.Rokt.getLocalSessionAttributes();
171+
}
172+
161173
function replaceOtherWithEmailsha256(_data) {
162174
var data = mergeObjects({}, _data || {});
163175
if (_data.hasOwnProperty(OTHER_IDENTITY)) {
@@ -214,14 +226,7 @@ var RoktKit = (function (exports) {
214226

215227
var filteredUserIdentities = returnUserIdentities(filteredUser);
216228

217-
var localSessionAttributes = {};
218-
219-
try {
220-
localSessionAttributes =
221-
window.mParticle.Rokt.getLocalSessionAttributes();
222-
} catch (error) {
223-
console.error('Error getting local session attributes:', error);
224-
}
229+
var localSessionAttributes = returnLocalSessionAttributes();
225230

226231
var selectPlacementsAttributes = mergeObjects(
227232
filteredUserIdentities,
@@ -259,6 +264,7 @@ var RoktKit = (function (exports) {
259264
function processEvent(event) {
260265
if (
261266
!isKitReady() ||
267+
isEmpty(self.placementEventMappingLookup) ||
262268
typeof window.mParticle.Rokt.setLocalSessionAttribute !== 'function'
263269
) {
264270
return;
@@ -395,7 +401,7 @@ var RoktKit = (function (exports) {
395401

396402
function generateIntegrationName(customIntegrationName) {
397403
var coreSdkVersion = window.mParticle.getVersion();
398-
var kitVersion = "1.7.1";
404+
var kitVersion = "1.7.2";
399405
var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion;
400406

401407
if (customIntegrationName) {
@@ -497,6 +503,10 @@ var RoktKit = (function (exports) {
497503
);
498504
}
499505

506+
function isEmpty(value) {
507+
return value == null || !(Object.keys(value) || value).length;
508+
}
509+
500510
if (window && window.mParticle && window.mParticle.addForwarder) {
501511
window.mParticle.addForwarder({
502512
name: name,

0 commit comments

Comments
 (0)