diff --git a/webadmin/src/js/client.js b/webadmin/src/js/client.js index 011cf4a04..cb8ddfd75 100644 --- a/webadmin/src/js/client.js +++ b/webadmin/src/js/client.js @@ -105,6 +105,7 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', function Client() { this._ready = false; this._configListener = []; + this._appsListener = []; this._readyListener = []; this._userInfo = { id: null, @@ -198,6 +199,11 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', if (this._config && this._config.apiServerOrigin) callback(this._config); }; + Client.prototype.onApps = function (callback) { + this._appsListener.push(callback); + callback(this._installedApps); + }; + Client.prototype.resetAvatar = function () { this.avatar = this.apiOrigin + '/api/v1/cloudron/avatar?' + String(Math.random()).slice(2); @@ -1068,6 +1074,10 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', } } + that._appsListener.forEach(function (callback) { + callback(that._installedApps); + }); + callback(null); }); };