From bf84063a3c8751df7395f6fc8837658052e85bd5 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 16 Nov 2020 16:17:03 +0800 Subject: [PATCH] root --- src/forge/Main/CoderRootDirectory.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js index 1f3593d46..536d3407c 100644 --- a/src/forge/Main/CoderRootDirectory.js +++ b/src/forge/Main/CoderRootDirectory.js @@ -209,12 +209,11 @@ class CoderRootDirectory extends Component { isSpin:false }) if(result){ - if( entries && entries.length > 0){ - let { chooseType } = this.state; - // 当前返回的子目录只有一条数据,且这条数据返回的是文件类型 - if(entries.length === 1 && (entries[0].type === "file" || chooseType ==="file")){ + if( entries){ + // 返回对象entries.type + if(entries.type){ this.setState({ - fileDetail:entries, + fileDetail:[entries], rootList:undefined, subFileType:false })