Skip to content

Commit f28f1c9

Browse files
committed
v8.4.6
1 parent 1c2948e commit f28f1c9

File tree

7 files changed

+34
-5
lines changed

7 files changed

+34
-5
lines changed

build/index.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.

demo/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ Gleap.log("Test log err", "ERROR");
2121

2222
Gleap.trackEvent("Master Event");
2323

24+
Gleap.identify("123456789", {
25+
name: "John Doe",
26+
email: "john@doe.com",
27+
customData: {
28+
yyy: "xxx",
29+
penis: true
30+
}
31+
});
32+
2433
// Register custom action.
2534
Gleap.registerCustomAction((customAction) => {
2635
console.log("Custom action called:");

index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export namespace Gleap {
6868
customerData: {
6969
name?: string;
7070
email?: string;
71+
phone?: string;
72+
value?: number;
73+
customData?: object;
7174
},
7275
userHash?: string
7376
): void;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "8.4.5",
3+
"version": "8.4.6",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/8.4.6/index.js

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

published/latest/index.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/GleapSession.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export default class GleapSession {
221221
var userDataKeys = Object.keys(userData);
222222
for (var i = 0; i < userDataKeys.length; i++) {
223223
var userDataKey = userDataKeys[i];
224-
if (this.session[userDataKey] !== userData[userDataKey]) {
224+
if (JSON.stringify(this.session[userDataKey]) !== JSON.stringify(userData[userDataKey])) {
225225
return true;
226226
}
227227
}
@@ -232,6 +232,7 @@ export default class GleapSession {
232232

233233
identifySession = (userId, userData, userHash) => {
234234
const sessionNeedsUpdate = this.checkIfSessionNeedsUpdate(userId, userData);
235+
console.log("sessionNeedsUpdate", sessionNeedsUpdate);
235236
if (!sessionNeedsUpdate) {
236237
return;
237238
}
@@ -273,9 +274,24 @@ export default class GleapSession {
273274
}
274275
}
275276
};
277+
278+
var dataToSend = {
279+
...userData
280+
};
281+
282+
if (userData.customData) {
283+
delete dataToSend['customData'];
284+
dataToSend = {
285+
...dataToSend,
286+
...userData.customData,
287+
}
288+
}
289+
290+
console.log("dataToSend", dataToSend);
291+
276292
http.send(
277293
JSON.stringify({
278-
...userData,
294+
...dataToSend,
279295
userId,
280296
userHash,
281297
})

0 commit comments

Comments
 (0)