mirror of
https://github.com/flarum/core.git
synced 2025-07-25 10:41:24 +02:00
Actually implement persistent avatar removal in the front-end
This commit is contained in:
@@ -85,8 +85,19 @@ export default class AvatarEditor extends Component {
|
||||
}
|
||||
|
||||
remove() {
|
||||
this.props.user.pushData({avatarUrl: null});
|
||||
delete this.props.user.avatarColor;
|
||||
var self = this;
|
||||
var user = this.props.user;
|
||||
self.loading(true);
|
||||
m.redraw();
|
||||
m.request({
|
||||
method: 'DELETE',
|
||||
url: app.config['api_url']+'/users/'+user.id()+'/avatar',
|
||||
config: app.session.authorize.bind(app.session)
|
||||
}).then(function(data) {
|
||||
self.loading(false);
|
||||
app.store.pushPayload(data);
|
||||
delete user.avatarColor;
|
||||
m.redraw();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user