mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 07:42:48 +08:00
Actually implement persistent avatar removal in the front-end
This commit is contained in:
parent
811df6c278
commit
f35fe5d0e2
|
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user