Fix iOS paste screenshot (#5785) (#5787)

(cherry picked from commit dd866ffeb8)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Mattermost Build 2021-10-24 21:59:55 +02:00 committed by GitHub
parent 23cd0087d7
commit 69ee750245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,10 +213,16 @@ export default class Uploads extends PureComponent {
let exceed = false;
const uploadFiles = [];
const totalFiles = files.length;
let i = 0;
while (i < totalFiles) {
const file = files[i];
if (file.error) {
i++;
continue;
}
if (!file.fileSize | !file.fileName) {
const path = (file.path || file.uri).replace('file://', '');
// eslint-disable-next-line no-await-in-loop
@ -229,6 +235,7 @@ export default class Uploads extends PureComponent {
exceed = true;
break;
}
uploadFiles.push(file);
i++;
}
@ -236,7 +243,7 @@ export default class Uploads extends PureComponent {
if (exceed) {
this.handleFileSizeWarning();
} else {
this.props.initUploadFiles(files, this.props.rootId);
this.props.initUploadFiles(uploadFiles, this.props.rootId);
this.hideError();
}
};