Skip to content

Commit

Permalink
Web: Files: fixed upload
Browse files Browse the repository at this point in the history
  • Loading branch information
gopienkonikita committed Oct 27, 2021
1 parent 93545f0 commit f923786
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions products/ASC.Files/Client/src/store/UploadDataStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ class UploadDataStore {
file.inConversion = false;
}
});
this.refreshFiles(toFolderId, false);

//this.refreshFiles(toFolderId, false);
break;
}

Expand All @@ -336,7 +337,7 @@ class UploadDataStore {
}
});

this.refreshFiles(toFolderId, false);
this.refreshFiles(toFolderId, false, file);
const percent = this.getConversationPercent(index + 1);
this.setConversionPercent(percent, !!error);
}
Expand Down Expand Up @@ -456,21 +457,35 @@ class UploadDataStore {
this.selectedFolderStore.id === folderId &&
window.location.pathname.indexOf("/history") === -1
) {
const { files, setFiles, folders, setFolders, filter } = this.filesStore;
const {
files,
setFiles,
folders,
setFolders,
filter,
setFilter,
} = this.filesStore;

const addNewFile = () => {
if (folderInfo) {
newFolders.push(folderInfo);
folderInfo && newFolders.unshift(folderInfo);
setFolders(newFolders);
} else {
newFiles.push(currentFile.fileInfo);
currentFile &&
currentFile.fileInfo &&
newFiles.unshift(currentFile.fileInfo);
setFiles(newFiles);
}

const newFilter = filter;
newFilter.total = newFilter.total += 1;
};

const newFiles = files;
const newFolders = folders;

if (!currentFile && !folderInfo) return;

if (filter.total >= filter.pageCount) {
if (files.length) {
newFiles.pop();
Expand All @@ -489,9 +504,9 @@ class UploadDataStore {
}
};

throttleRefreshFiles = throttle((toFolderId, currentFile, folderInfo) => {
throttleRefreshFiles = (toFolderId, currentFile, folderInfo) => {
return this.refreshFiles(toFolderId, true, currentFile, folderInfo);
}, 1000);
};

uploadFileChunks = async (
location,
Expand Down

0 comments on commit f923786

Please sign in to comment.