Skip to content

Commit

Permalink
Web: Files: Fixed last page operations after merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaLopaeva committed Dec 30, 2021
1 parent 84b1a18 commit f2134c7
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions products/ASC.Files/Client/src/store/FilesActionsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,36 @@ class FilesActionStore {
clearSecondaryProgressData,
} = this.uploadDataStore.secondaryProgressDataStore;

const { filter, fetchFiles } = this.filesStore;
fetchFiles(this.selectedFolderStore.id, filter, true, true).finally(() => {
const {
filter,
fetchFiles,
isEmptyLastPageAfterOperation,
resetFilterPage,
} = this.filesStore;
let newFilter;

const selectionFilesLength =
fileIds && folderIds
? fileIds.length + folderIds.length
: fileIds?.length || folderIds?.length;

if (
selectionFilesLength &&
isEmptyLastPageAfterOperation(selectionFilesLength)
) {
newFilter = resetFilterPage();
}

fetchFiles(
this.selectedFolderStore.id,
newFilter ? newFilter : filter,
true,
true
).finally(() => {
this.uploadDataStore.clearActiveOperations(fileIds, folderIds);
setTimeout(() => clearSecondaryProgressData(), TIMEOUT);
}); };
});
};

deleteAction = async (translations, newSelection = null) => {
const { isRecycleBinFolder, isPrivacyFolder } = this.treeFoldersStore;
Expand Down

0 comments on commit f2134c7

Please sign in to comment.