1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

add folder in empty view tree (#7357)

Co-authored-by: zhouwenxuan <aries@Mac.local>
This commit is contained in:
Aries
2025-01-22 17:53:03 +08:00
committed by GitHub
parent c48aa43ead
commit a4738295db
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [window.app.pageOptions.enableMetadataManagement, currentRepoInfo]);
const { isLoading, navigation } = useMetadata();
const { isLoading } = useMetadata();
const { enableMetadata } = useMetadataStatus();
let [isSettingsDialogOpen, setSettingsDialogOpen] = useState(false);
@@ -58,7 +58,7 @@ const DirViews = ({ userPerm, repoID, currentPath, currentRepoInfo }) => {
>
{!enableMetadata ? (
<ExtensionPrompts onExtendedProperties={onExtendedProperties} />
) : !isLoading && Array.isArray(navigation) && navigation.length > 0 ? (
) : !isLoading ? (
<MetadataTreeView userPerm={userPerm} currentPath={currentPath} />
) : null}
</TreeSection>

View File

@@ -154,7 +154,7 @@ const MetadataTreeView = ({ userPerm, currentPath }) => {
<div className="tree-view tree metadata-tree-view">
<div className="tree-node">
<div className="children">
{navigation.map((item, index) => {
{Array.isArray(navigation) && navigation.length > 0 && navigation.map((item, index) => {
if (item.type === VIEWS_TYPE_FOLDER) {
return renderFolder(item, index);
}