diff --git a/client/js/loading-error-handlers.js b/client/js/loading-error-handlers.js index 79523547..785a786c 100644 --- a/client/js/loading-error-handlers.js +++ b/client/js/loading-error-handlers.js @@ -9,7 +9,15 @@ */ (function() { - document.getElementById("loading-page-message").textContent = "Loading the app…"; + const msg = document.getElementById("loading-page-message"); + + if (msg) { + msg.textContent = "Loading the app…"; + + document.getElementById("loading-reload").addEventListener("click", function() { + location.reload(true); + }); + } var displayReload = function displayReload() { var loadingReload = document.getElementById("loading-reload"); @@ -32,10 +40,6 @@ } }, 5000); - document.getElementById("loading-reload").addEventListener("click", function() { - location.reload(); - }); - window.g_LoungeErrorHandler = function LoungeErrorHandler(e) { var message = document.getElementById("loading-page-message"); message.textContent = "An error has occurred that prevented the client from loading correctly.";