Add Client.resetAvatar()
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user