Skip to content

Commit 04eb3ea

Browse files
Bug fixes (#230)
* Added undefined check on status bar removal * Navigating to base url no longer breaks check status functionality on subscription page * There is no longer an empty message when switching to an offline backend while in the information page.
1 parent f993628 commit 04eb3ea

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/main/resources/static/js/errorMessages.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ ko.applyBindings(vm, $("#alertsItem")[0]);
6969
vm.stopPropagation();
7070

7171
function logMessage(message) {
72-
$.jGrowl(message, { sticky: false, theme: 'Error', position: 'center' });
73-
vm.addErrorMessage(message);
74-
vm.storeErrorMessage(message);
75-
vm.stopPropagation();
72+
if (message != undefined && message != "") {
73+
$.jGrowl(message, { sticky: false, theme: 'Error', position: 'center' });
74+
vm.addErrorMessage(message);
75+
vm.storeErrorMessage(message);
76+
vm.stopPropagation();
77+
}
7678
}
7779

7880
function parseAndLogMessage(message) {

src/main/resources/static/js/status-handler.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ and reload subscriptions in subscription list depending on the back-end status.
99
// Start ## Status Indicator ##
1010

1111
function checkBackendStatus() {
12-
const currentUrl = router._lastRouteResolved.url;
12+
var currentUrl = router._lastRouteResolved.url;
13+
currentUrl = currentUrl.replace(/^\//, '');
1314
var isWhitelistedPage = !stringContainsSubstring(getWhiteListedPages(), currentUrl);
1415
if (isWhitelistedPage) {
1516
return;
@@ -34,7 +35,6 @@ function routeSpecificFunctions(currentUrl) {
3435
if (currentUrl === "subscriptions") {
3536
reDrawTable(isStatusChanged);
3637
updateConnectionButtonsStatus();
37-
3838
}
3939

4040
if (currentUrl !== "subscriptions") {
@@ -115,7 +115,10 @@ function addStatusIndicator(statusType, statusText) {
115115
}
116116

117117
function removeStatusIndicator() {
118-
$($(".content")[0].previousElementSibling).remove();
118+
var parentContent = $(".content")[0];
119+
if (parentContent != undefined) {
120+
$(parentContent.previousElementSibling).remove();
121+
}
119122
}
120123
// End ## Status Indicator ##
121124

0 commit comments

Comments
 (0)