Skip to content

Commit db4d6ac

Browse files
authored
Merge pull request #6294 from Countly/SER-2434
[SER-2434] Formula -> count events struck at loading for B
2 parents c05c1b0 + 295bce6 commit db4d6ac

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ Enterprise Features:
66
- [oidc] PKCE Flow support added
77

88
Fixes:
9+
- [core] Fix auto refresh frontend component
910
- [core] Unifying alphabetical order for dropdowns with dashboard apps
11+
- [formulas] Fix loading state when selecting event count
1012
- [hooks] Added null check for incoming data
11-
- [core] Fix auto refresh frontend component
12-
- [times-of-day] Fix chart component
1313
- [push] Fix external drawer initialization
14+
- [times-of-day] Fix chart component
1415

1516
Enterprise Fixes:
1617
- [content] Asset URL was wrongly constructed when user switches between apps

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)