Skip to content

Commit 2878765

Browse files
committed
[SERVER-786] Prevent duplicate list loading
Fix applied to : crashes, assistant
1 parent 1dab5d5 commit 2878765

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ var AppRouter = Backbone.Router.extend({
304304
dateFromSelected: null, //date from selected from the date picker
305305
activeAppName: '',
306306
activeAppKey: '',
307+
_isFirstLoad:false, //to know if we are switching between two apps or just loading page
307308
refreshActiveView: 0, //refresh interval function reference
308309
/**
309310
* Navigate to another view programmatically. If you need to change the view without user clicking anything, like redirect. You can do this using this method. This method is not define by countly but is direct method of AppRouter object in Backbone js
@@ -1995,7 +1996,7 @@ var AppRouter = Backbone.Router.extend({
19951996
$.fn.dataTableExt.sErrMode = 'throw';
19961997
$(document).ready(function () {
19971998
setTimeout(function () {
1998-
self.onAppSwitch(countlyCommon.ACTIVE_APP_ID, true);
1999+
self.onAppSwitch(countlyCommon.ACTIVE_APP_ID, true,true);
19992000
}, 1)
20002001
});
20012002
},
@@ -2315,8 +2316,9 @@ var AppRouter = Backbone.Router.extend({
23152316
this.refreshScripts[view] = [];
23162317
this.refreshScripts[view].push(callback);
23172318
},
2318-
onAppSwitch: function (appId, refresh) {
2319+
onAppSwitch: function (appId, refresh,firstLoad) {
23192320
if (appId != 0) {
2321+
this._isFirstLoad = firstLoad;
23202322
jQuery.i18n.map = JSON.parse(app.origLang);
23212323
if (!refresh) {
23222324
app.main(true);

plugins/assistant/frontend/public/javascripts/countly.views.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ $(document).ready(function() {
223223
}, 60000);
224224

225225
app.addAppSwitchCallback(function(appId){
226-
AssistantView.initialize();
226+
if(app._isFirstLoad!=true)
227+
AssistantView.initialize();
227228
});
228229

229230
$(document).on("/i/apps/reset", function() {

plugins/crashes/frontend/public/javascripts/countly.views.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,8 @@ $( document ).ready(function() {
16481648
if(typeof extendViewWithFilter === "function")
16491649
extendViewWithFilter(app.crashesView);
16501650
app.addAppSwitchCallback(function(appId){
1651-
countlyCrashes.loadList(appId);
1651+
if(app._isFirstLoad!=true)
1652+
countlyCrashes.loadList(appId);
16521653
});
16531654
if(!production){
16541655
CountlyHelpers.loadJS("crashes/javascripts/marked.min.js");

0 commit comments

Comments
 (0)