Merge pull request #923 from ONLYOFFICE/bugfix/file-conversion

Bugfix/file conversion
This commit is contained in:
Nikita Gopienko 2022-10-18 13:10:16 +03:00 committed by GitHub
commit 26d4e5427f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -253,11 +253,13 @@ class UploadDataStore {
if (!this.filesToConversion.length) {
this.filesToConversion.push(file);
this.uploadedFilesHistory.push(file);
if (!secondConvertingWithPassword && !conversionPositionIndex)
this.uploadedFilesHistory.push(file);
this.startConversion(t);
} else {
this.filesToConversion.push(file);
this.uploadedFilesHistory.push(file);
if (!secondConvertingWithPassword && !conversionPositionIndex)
this.uploadedFilesHistory.push(file);
}
}
};
@ -399,13 +401,19 @@ class UploadDataStore {
}
if (progress === 100) {
if (!error) error = data[0].error;
runInAction(() => {
const file = this.files.find((file) => file.fileId === fileId);
if (file) {
file.error = error;
file.convertProgress = progress;
file.inConversion = false;
file.action = "converted";
if (error.indexOf("password") !== -1) {
file.needPassword = true;
} else file.action = "converted";
}
const historyFile = this.uploadedFilesHistory.find(
@ -413,9 +421,13 @@ class UploadDataStore {
);
if (historyFile) {
historyFile.error = error;
historyFile.convertProgress = progress;
historyFile.inConversion = false;
historyFile.action = "converted";
if (error.indexOf("password") !== -1) {
historyFile.needPassword = true;
} else historyFile.action = "converted";
}
});