Skip to content

Commit 7e6b005

Browse files
authored
Merge pull request #6771 from Countly/funnel-cache-24
Fix multiple ajax request in event selector, update changelog
2 parents 54a280d + c0386f3 commit 7e6b005

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
## Version 24.05.xx
22
Fixes:
33
- [mail] add smtp debug option for mail module
4-
4+
- [core] Fix multiple ajax request in event selector
5+
6+
Enterprise Fixes:
7+
- [funnels] Show notification if funnel results are from cache/task manager
8+
9+
510
## Version 24.05.41
611
Enterprise Fixes:
712
- [cohorts] Fix query transformation for profile group

frontend/express/public/javascripts/countly/countly.event.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
_period = null;
1818
var _activeLoadedEvent = "";
1919
var _activeLoadedSegmentation = "";
20+
var _refreshEventsPromise = null;
2021

2122
countlyEvent.hasLoadedData = function() {
2223
if (_activeLoadedEvent && _activeLoadedEvent === _activeEvent && _activeLoadedSegmentation === _activeSegmentation) {
@@ -497,7 +498,11 @@
497498

498499
countlyEvent.refreshEvents = function() {
499500
if (!countlyCommon.DEBUG) {
500-
return $.ajax({
501+
if (_refreshEventsPromise) {
502+
return _refreshEventsPromise;
503+
}
504+
505+
_refreshEventsPromise = $.ajax({
501506
type: "GET",
502507
url: countlyCommon.API_PARTS.data.r,
503508
data: {
@@ -510,8 +515,13 @@
510515
if (!_activeEvent && countlyEvent.getEvents()[0]) {
511516
_activeEvent = countlyEvent.getEvents()[0].key;
512517
}
518+
},
519+
complete: function() {
520+
_refreshEventsPromise = null;
513521
}
514522
});
523+
524+
return _refreshEventsPromise;
515525
}
516526
else {
517527
_activeEvents = {};

0 commit comments

Comments
 (0)