making avatar cropping work

This commit is contained in:
or-else
2021-07-10 19:11:21 -07:00
parent 0195aae6ff
commit f2cd1ba0f2
9 changed files with 45 additions and 10 deletions
+5
View File
@@ -27,6 +27,11 @@ export default class AvatarUpload extends React.Component {
handleFileUpload(e) {
const image = e.target.files[0];
if (this.props.onImageReceived) {
this.props.onFileReceived(URL.createObjectURL(image));
return;
}
if (image.size > MAX_AVATAR_BYTES) {
// Too large to send inband - uploading out of band and sending as a link.
const uploader = this.props.tinode.getLargeFileHelper();