Merge branch 'develop' into bugifx/Bug61352

This commit is contained in:
Viktor Fomin 2023-02-27 11:51:40 +03:00
commit d7da99b027
2 changed files with 28 additions and 1 deletions

View File

@ -373,6 +373,7 @@ export default inject(
convertFile,
files: uploadedFiles,
clearUploadedFilesHistory,
isParallel,
} = uploadDataStore;
const {
playlist,
@ -402,7 +403,11 @@ export default inject(
return {
isPersonal: personal,
theme,
currentFileUploadProgress,
currentFileUploadProgress: isParallel
? item?.percent
? item.percent
: null
: currentFileUploadProgress,
uploaded,
isMedia,
fileIcon,

View File

@ -852,6 +852,12 @@ class UploadDataStore {
const percentCurrentFile = (index / length) * 100;
const fileIndex = this.uploadedFilesHistory.findIndex(
(f) => f.uniqueId === this.files[indexOfFile].uniqueId
);
if (fileIndex > -1)
this.uploadedFilesHistory[fileIndex].percent = percentCurrentFile;
this.primaryProgressDataStore.setPrimaryProgressBarData({
icon: "upload",
percent: newPercent,
@ -1046,6 +1052,12 @@ class UploadDataStore {
return { location, requestsDataArray, fileSize, path };
})
.then(({ location, requestsDataArray, fileSize, path }) => {
const fileIndex = this.uploadedFilesHistory.findIndex(
(f) => f.uniqueId === this.files[indexOfFile].uniqueId
);
if (fileIndex > -1)
this.uploadedFilesHistory[fileIndex].percent = chunks < 2 ? 50 : 0;
if (!this.isParallel) {
this.primaryProgressDataStore.setPrimaryProgressBarData({
icon: "upload",
@ -1102,6 +1114,16 @@ class UploadDataStore {
alert: true,
});
if (this.isParallel) {
this.currentUploadNumber -= 1;
const nextFileIndex = this.files.findIndex((f) => !f.inAction);
if (nextFileIndex !== -1) {
this.startSessionFunc(nextFileIndex, t);
}
}
return Promise.resolve();
})
.finally(() => {