fix failure to upload large avatar

This commit is contained in:
or-else
2021-10-10 11:13:38 -07:00
parent 0f031d2f0d
commit e3ae013875
8 changed files with 16 additions and 21 deletions
+2 -4
View File
@@ -141,10 +141,8 @@ export default class TopicDescEdit extends React.Component {
if (width > AVATAR_SIZE || height > AVATAR_SIZE || width != height) {
// Avatar is not square or too large even after cropping. Shrink it and make square.
imageScaled(blob, AVATAR_SIZE, AVATAR_SIZE, MAX_EXTERN_ATTACHMENT_SIZE, true)
.then(scaled => readyToUpload)
.catch(err => {
this.props.onError(err, 'err');
});
.then(scaled => readyToUpload(scaled))
.catch(err => this.props.onError(err, 'err'));
} else {
readyToUpload({mime: mime, blob: blob, width: width, height: height});
}