fixup offline banner to not show prematurely onload

This commit is contained in:
Johannes Zellner
2022-02-26 14:01:05 +01:00
parent 1c6d86d760
commit bbcb596ffa

View File

@@ -237,13 +237,13 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
function defaultErrorHandler(callback) {
function handleServerOffline() {
if (client.offline) return;
client.offline = true;
(function onlineCheck() {
$http.get(client.apiOrigin + '/api/v1/cloudron/status', {}).success(function (data, status) {
client.offline = false;
client._reconnectListener.forEach(function (handler) { handler(); });
}).error(function (data, status) {
client.offline = true;
$timeout(onlineCheck, 5000);
});
})();