Skip to content

Commit 62b6499

Browse files
authored
Merge pull request #31 from Countly/11.4-fix
Content multi fix
2 parents bbd0198 + 4f6915d commit 62b6499

File tree

6 files changed

+25
-4
lines changed

6 files changed

+25
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 24.11.4
2+
3+
* Mitigated an issue where `content` and `feedback` interfaces would not work with async multi instances.
4+
15
## 24.11.3
26

37
* Added support for content resizing (Experimental!)

cypress/fixtures/multi_instance.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@
124124
Countly.q.push(["YOUR_APP_KEY3", "collect_from_forms"]);
125125
Countly.q.push(["YOUR_APP_KEY3", "collect_from_facebook"]);
126126
Countly.q.push(["YOUR_APP_KEY3", "opt_in"]);
127+
Countly.q.push(["YOUR_APP_KEY3", "feedback.showNPS"]);
128+
Countly.q.push(["YOUR_APP_KEY3", "content.enterContentZone"]);
127129

128130
//initialize fourth instance for another app asynchronously
129131
Countly.q.push(["init", {
@@ -158,6 +160,8 @@
158160
Countly.q.push(["YOUR_APP_KEY4", "collect_from_forms"]);
159161
Countly.q.push(["YOUR_APP_KEY4", "collect_from_facebook"]);
160162
Countly.q.push(["YOUR_APP_KEY4", "opt_in"]);
163+
Countly.q.push(["YOUR_APP_KEY4", "feedback.showNPS"]);
164+
Countly.q.push(["YOUR_APP_KEY4", "content.enterContentZone"]);
161165
</script>
162166
</head>
163167
</html>

modules/Constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var healthCheckCounterEnum = Object.freeze({
104104
errorMessage: "cly_hc_error_message",
105105
});
106106

107-
var SDK_VERSION = "24.11.3";
107+
var SDK_VERSION = "24.11.4";
108108
var SDK_NAME = "javascript_native_web";
109109

110110
// Using this on document.referrer would return an array with 17 elements in it. The 12th element (array[11]) would be the path we are looking for. Others would be things like password and such (use https://regex101.com/ to check more)

modules/CountlyClass.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4223,12 +4223,25 @@ constructor(ob) {
42234223
if (typeof inst[req[arg]] === "function") {
42244224
inst[req[arg]].apply(inst, req.slice(arg + 1));
42254225
}
4226+
// Add interfaces you add to here for async queue to work
42264227
else if (req[arg].indexOf("userData.") === 0) {
42274228
var userdata = req[arg].replace("userData.", "");
42284229
if (typeof inst.userData[userdata] === "function") {
42294230
inst.userData[userdata].apply(inst, req.slice(arg + 1));
42304231
}
42314232
}
4233+
else if (req[arg].indexOf("content.") === 0) {
4234+
var contentMethod = req[arg].replace("content.", "");
4235+
if (typeof inst.content[contentMethod] === "function") {
4236+
inst.content[contentMethod].apply(inst, req.slice(arg + 1));
4237+
}
4238+
}
4239+
else if (req[arg].indexOf("feedback.") === 0) {
4240+
var feedbackMethod = req[arg].replace("feedback.", "");
4241+
if (typeof inst.feedback[feedbackMethod] === "function") {
4242+
inst.feedback[feedbackMethod].apply(inst, req.slice(arg + 1));
4243+
}
4244+
}
42324245
else if (typeof Countly[req[arg]] === "function") {
42334246
Countly[req[arg]].apply(Countly, req.slice(arg + 1));
42344247
}

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "countly-sdk-js",
3-
"version": "24.11.3",
3+
"version": "24.11.4",
44
"description": "Countly JavaScript SDK",
55
"type": "module",
66
"main": "Countly.js",

0 commit comments

Comments
 (0)