diff --git a/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/AsideView.js b/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/AsideView.js
index 23184f0d521..f1273417e41 100644
--- a/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/AsideView.js
+++ b/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/AsideView.js
@@ -29,6 +29,7 @@ const SelectFolderDialogAsideView = ({
canCreate,
isLoading,
primaryButtonName,
+ noTreeSwitcher,
}) => {
return (
@@ -62,7 +63,7 @@ const SelectFolderDialogAsideView = ({
displayType={DISPLAY_TYPE}
showButtons={showButtons}
isFooter={!!footer}
- folderListLength={folderList?.length}
+ noTreeSwitcher={noTreeSwitcher}
>
{header}
diff --git a/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/ModalView.js b/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/ModalView.js
index 5265c569944..b4632430102 100644
--- a/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/ModalView.js
+++ b/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/ModalView.js
@@ -27,6 +27,7 @@ const SelectFolderDialogModalView = ({
canCreate,
isLoading,
primaryButtonName,
+ noTreeSwitcher,
}) => {
return (
@@ -44,7 +45,7 @@ const SelectFolderDialogModalView = ({
{header}
) : (
);
}
@@ -666,11 +669,25 @@ class SelectFolderDialog extends React.Component {
static convertFolders = (folders, arrayOfExceptions) => {
let newArray = [];
+ let noSubfoldersCount = 0;
+ let needHideSwitcher = false;
for (let i = 0; i < folders.length; i++) {
- !arrayOfExceptions.includes(folders[i].rootFolderType) &&
+ if (!arrayOfExceptions.includes(folders[i].rootFolderType)) {
newArray.push(folders[i]);
+
+ if (
+ folders[i].foldersCount === 0 ||
+ folders[i].rootFolderType === FolderType.Privacy
+ ) {
+ noSubfoldersCount += 1;
+ }
+ }
+ }
+
+ if (newArray.length === noSubfoldersCount) {
+ needHideSwitcher = true;
}
- return newArray;
+ return [newArray, needHideSwitcher];
};
render() {
return (
diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js
index 78b9cb9250b..411f1ee7981 100644
--- a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js
+++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js
@@ -535,7 +535,7 @@ class SharingPanelComponent extends React.Component {
/>