Skip to content

Commit 38fa1c1

Browse files
Fix clear interval (#187)
* The polling was still active on routes where it shouldn't have been
1 parent 56e3d1e commit 38fa1c1

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

src/main/resources/static/js/common.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,29 +90,35 @@ function formatUrl(host, port, useHttps, contextPath) {
9090
// Start ## Routing ##
9191
var routes = {};
9292
routes["subscriptions"] = function () {
93+
window.clearInterval(timerInterval);
9394
updateBackEndInstanceList();
9495
$(".app-header").removeClass("header-bar-hidden");
9596
$(".main").load("subscriptionpage.html");
9697
};
9798
routes["test-rules"] = function () {
99+
window.clearInterval(timerInterval);
98100
updateBackEndInstanceList();
99101
$(".app-header").removeClass("header-bar-hidden");
100102
$(".main").load("testRules.html");
101103
};
102104
routes["ei-info"] = function () {
105+
window.clearInterval(timerInterval);
103106
updateBackEndInstanceList();
104107
$(".app-header").removeClass("header-bar-hidden");
105108
$(".main").load("eiInfo.html");
106109
};
107110
routes["switch-backend"] = function () {
111+
window.clearInterval(timerInterval);
108112
$(".app-header").addClass("header-bar-hidden");
109113
$(".main").load("switch-backend.html");
110114
};
111115
routes["add-backend"] = function () {
116+
window.clearInterval(timerInterval);
112117
$(".app-header").addClass("header-bar-hidden");
113118
$(".main").load("add-instances.html");
114119
};
115120
routes["login"] = function () {
121+
window.clearInterval(timerInterval);
116122
updateBackEndInstanceList();
117123
$(".app-header").removeClass("header-bar-hidden");
118124
$(".main").load("login.html");

src/main/resources/static/js/eiInfo.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ jQuery(document).ready(function () {
184184
checkBackendStatus();
185185

186186
// Check if EI Backend Server is online every X seconds
187-
if(timerInterval != null) {
188-
window.clearInterval(timerInterval);
189-
}
190187
timerInterval = window.setInterval(function () { checkBackendStatus(); }, 15000);
191188

192189
// END OF EI Backend Server check #########################################

src/main/resources/static/js/subscription.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ jQuery(document).ready(function () {
6363
$("#subButtons").show();
6464
}
6565

66-
// Check if EI Backend Server is online every X seconds
67-
if(timerInterval != null) {
68-
window.clearInterval(timerInterval);
69-
}
7066
timerInterval = window.setInterval(function () { checkBackendStatus(); }, 15000);
7167

7268
// Check if buttons should be enabled or disabled

src/main/resources/static/js/testrules.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,6 @@ jQuery(document).ready(function () {
355355
checkBackendStatus();
356356

357357
// Check if EI Backend Server is online every X seconds
358-
if (timerInterval != null) {
359-
window.clearInterval(timerInterval);
360-
}
361358
timerInterval = window.setInterval(function () { checkBackendStatus(); }, 15000);
362359

363360
// END OF EI Backend Server check #########################################

0 commit comments

Comments
 (0)