Skip to content

Commit 3af1342

Browse files
[WEB-3694] Custom CT-ID - Rebased
1 parent 34af2a9 commit 3af1342

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

clevertap.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16197,7 +16197,7 @@
1619716197
}
1619816198

1619916199
constructor() {
16200-
var _clevertap$account, _clevertap$account2, _clevertap$account3, _clevertap$account4, _clevertap$account5, _clevertap$config, _clevertap$account6;
16200+
var _clevertap$account, _clevertap$account2, _clevertap$account3, _clevertap$account4, _clevertap$account5, _clevertap$config, _clevertap$config2, _clevertap$account6;
1620116201

1620216202
let clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1620316203
Object.defineProperty(this, _sendLocationData, {
@@ -16290,7 +16290,7 @@
1629016290

1629116291
const result = validateCustomCleverTapID(clevertap === null || clevertap === void 0 ? void 0 : (_clevertap$config = clevertap.config) === null || _clevertap$config === void 0 ? void 0 : _clevertap$config.customId);
1629216292

16293-
if (!(result === null || result === void 0 ? void 0 : result.isValid)) {
16293+
if (!(result === null || result === void 0 ? void 0 : result.isValid) && (clevertap === null || clevertap === void 0 ? void 0 : (_clevertap$config2 = clevertap.config) === null || _clevertap$config2 === void 0 ? void 0 : _clevertap$config2.customId)) {
1629416294
_classPrivateFieldLooseBase(this, _logger)[_logger].error(result === null || result === void 0 ? void 0 : result.error);
1629516295
}
1629616296

@@ -17008,7 +17008,10 @@
1700817008
_classPrivateFieldLooseBase(this, _account)[_account].token = token;
1700917009
}
1701017010

17011-
this.createCustomIdIfValid(config === null || config === void 0 ? void 0 : config.customId);
17011+
if (config === null || config === void 0 ? void 0 : config.customId) {
17012+
this.createCustomIdIfValid(config === null || config === void 0 ? void 0 : config.customId);
17013+
}
17014+
1701217015
const currLocation = location.href;
1701317016
const urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq
1701417017

clevertap.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clevertap.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/clevertap.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default class CleverTap {
107107

108108
const result = validateCustomCleverTapID(clevertap?.config?.customId)
109109

110-
if (!result?.isValid) {
110+
if (!result?.isValid && clevertap?.config?.customId) {
111111
this.#logger.error(result?.error)
112112
}
113113

@@ -709,8 +709,9 @@ export default class CleverTap {
709709
if (token) {
710710
this.#account.token = token
711711
}
712-
713-
this.createCustomIdIfValid(config?.customId)
712+
if (config?.customId) {
713+
this.createCustomIdIfValid(config?.customId)
714+
}
714715

715716
const currLocation = location.href
716717
const urlParams = getURLParams(currLocation.toLowerCase())

0 commit comments

Comments
 (0)