diff --git a/webadmin/src/js/client.js b/webadmin/src/js/client.js index 4e241907d..d5c4f0d17 100644 --- a/webadmin/src/js/client.js +++ b/webadmin/src/js/client.js @@ -86,7 +86,9 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', this._clientId = '<%= oauth.clientId %>'; this._clientSecret = '<%= oauth.clientSecret %>'; this.apiOrigin = '<%= oauth.apiOrigin %>'; - this.avatar = this.apiOrigin + '/api/v1/cloudron/avatar?' + String(Math.random()).slice(2); + this.avatar = ''; + + this.resetAvatar(); this.setToken(localStorage.token); } @@ -148,6 +150,15 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', callback(this._config); }; + Client.prototype.resetAvatar = function () { + this.avatar = this.apiOrigin + '/api/v1/cloudron/avatar?' + String(Math.random()).slice(2); + + var favicon = $('#favicon'); + + console.log('rseet favicon', favicon) + if (favicon) favicon.attr('href', this.avatar); + }; + Client.prototype.setUserInfo = function (userInfo) { // In order to keep the angular bindings alive, set each property individually this._userInfo.id = userInfo.id;