Do not redirect to error.html if the angular main application fails to init
We now only show the offline banner and retry the application init until box comes back up
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
/* global EventSource:false */
|
||||
/* global asyncForEach:false */
|
||||
|
||||
angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'Notification', function ($http, $interval, md5, Notification) {
|
||||
angular.module('Application').service('Client', ['$http', '$interval', '$timeout', 'md5', 'Notification', function ($http, $interval, $timeout, md5, Notification) {
|
||||
var client = null;
|
||||
|
||||
// variable available only here to avoid this._property pattern
|
||||
@@ -190,6 +190,13 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
Notification.error({ title: 'Cloudron Error', message: message });
|
||||
};
|
||||
|
||||
// handles application startup errors, mostly only when dashboard is loaded and api endpoint is down
|
||||
Client.prototype.initError = function (error, initFunction) {
|
||||
console.error('Application startup error', error);
|
||||
|
||||
$timeout(initFunction, 5000); // we will try to re-init the app
|
||||
};
|
||||
|
||||
Client.prototype.clearNotifications = function () {
|
||||
Notification.clearAll();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user