actually clear uploaded image

This commit is contained in:
or-else
2025-08-20 20:57:36 +03:00
parent 78f31b7cf1
commit 92611680e4
+5 -1
View File
@@ -75,6 +75,10 @@ export default class CreateAccountView extends React.PureComponent {
handleImageChanged(mime, img) {
this.setState({newAvatar: img, newAvatarMime: mime});
if (!img) {
// User cleared the image.
this.setState({imageUrl: null, uploadUrl: null});
}
}
handleToggleSaveToken() {
@@ -100,7 +104,7 @@ export default class CreateAccountView extends React.PureComponent {
// AvatarCropView calls this method when the user has cropped the image.
handleAvatarCropped(mime, blob, width, height) {
const url = blob ? URL.createObjectURL(blob) : null;
this.setState({avatar: url, newAvatar: null, newAvatarMime: null});
this.setState({newAvatar: null, newAvatarMime: null});
if (blob) {
this.uploadAvatar(mime, blob, width, height);
}