Fixes: Save profile picture automatically after upload

Fix jank when cropping large photos
This commit is contained in:
Tom Moor
2018-11-17 18:25:10 -08:00
parent d3834d2dc5
commit d74b99635e
3 changed files with 15 additions and 3 deletions

View File

@@ -52,8 +52,13 @@ class Profile extends React.Component<Props> {
this.name = ev.target.value;
};
handleAvatarUpload = (avatarUrl: string) => {
handleAvatarUpload = async (avatarUrl: string) => {
this.avatarUrl = avatarUrl;
await this.props.auth.updateUser({
avatarUrl: this.avatarUrl,
});
this.props.ui.showToast('Profile picture updated', 'success');
};
handleAvatarError = (error: ?string) => {