Skip to content

Commit 21b6ae9

Browse files
committed
Update main.js
1 parent 4a6ad83 commit 21b6ae9

File tree

1 file changed

+11
-31
lines changed

1 file changed

+11
-31
lines changed

demo/main.js

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,19 @@ Gleap.identify("user_19283", {
1212
value: 199
1313
});
1414

15-
Gleap.attachCustomData({
16-
mission: "Unicorn",
17-
type: "Demo App",
18-
nestedData: {
19-
possible: true,
20-
name: "Mission: Impossible - Ghost Protocol",
21-
},
22-
});
23-
2415
Gleap.log("Test log");
2516
Gleap.log("Test log info", "INFO");
2617
Gleap.log("Test log warn", "WARNING");
2718
Gleap.log("Test log err", "ERROR");
2819

29-
// Register custom action.
30-
Gleap.registerCustomAction((customAction) => {
31-
console.log("Custom action called:");
32-
console.log(customAction);
33-
});
34-
35-
// Network logs test.
36-
setTimeout(() => {
37-
console.log("Loading place infos");
38-
39-
var xmlhttp = new XMLHttpRequest();
40-
var url = "https://jsonplaceholder.typicode.com/todos/1";
41-
42-
xmlhttp.onreadystatechange = function () {
43-
if (this.readyState == 4 && this.status == 200) {
44-
var myArr = JSON.parse(this.responseText);
45-
console.log(myArr);
46-
}
47-
};
48-
xmlhttp.open("GET", url, true);
49-
xmlhttp.send();
50-
}, 3000);
20+
Gleap.on("open", () => {
21+
// Attach custom data.
22+
Gleap.attachCustomData({
23+
mission: "Unicorn",
24+
type: "Demo App",
25+
nestedData: {
26+
possible: true,
27+
name: "Mission: Impossible - Ghost Protocol",
28+
},
29+
});
30+
});

0 commit comments

Comments
 (0)