mirror of
https://github.com/flarum/core.git
synced 2025-07-30 05:00:56 +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() {
|
remove() {
|
||||||
this.props.user.pushData({avatarUrl: null});
|
var self = this;
|
||||||
delete this.props.user.avatarColor;
|
var user = this.props.user;
|
||||||
|
self.loading(true);
|
||||||
m.redraw();
|
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