Web:Files:HOCs: set parentId for selectedFolder if user click on empty folder

This commit is contained in:
Timofey Boyko 2022-04-27 14:20:08 +03:00
parent 7806d24a88
commit 5674e1b07f

View File

@ -121,7 +121,7 @@ export default function withFileActions(WrappedFileItem) {
};
onFilesClick = (e) => {
const { item, openFileAction } = this.props;
const { item, openFileAction, setParentId } = this.props;
if (
(e && e.target.tagName === "INPUT") ||
!!e.target.closest(".lock-file")
@ -129,6 +129,16 @@ export default function withFileActions(WrappedFileItem) {
return;
e.preventDefault();
if (
item.isFolder &&
item.parentId !== 0 &&
item.filesCount === 0 &&
item.foldersCount === 0
) {
setParentId(item.parentId);
}
openFileAction(item);
};
@ -222,7 +232,7 @@ export default function withFileActions(WrappedFileItem) {
filesActionsStore,
dialogsStore,
treeFoldersStore,
//selectedFolderStore,
selectedFolderStore,
filesStore,
uploadDataStore,
settingsStore,
@ -313,6 +323,7 @@ export default function withFileActions(WrappedFileItem) {
actionId: id,
checked: isFileSelected(item.id, item.parentId),
//parentFolder: selectedFolderStore.parentId,
setParentId: selectedFolderStore.setParentId,
canWebEdit,
canViewedDocs,
isTrashFolder: isRecycleBinFolder,