Commit ff2347ad by zhaochengxiang

bug fix

parent dd4c9f5c
......@@ -139,8 +139,7 @@ const AssetManageTree = (props) => {
if ((data??[]).length > 0) {
setTemplateType(data[0].type)
LocalStorage.set(`templateType-${appId}`, data[0].type)
onSelect?.('', '')
getAllDirectoryAsTree(false)
getAllDirectoryAsTree(true)
}
},
error: () => {
......@@ -184,9 +183,9 @@ const AssetManageTree = (props) => {
const getAllDirectoryAsTree = (resetCurrentDirId=true, defaultSelectedId='', refresh = false) => {
setLoading(true);
// if (resetCurrentDirId) {
// onSelect && onSelect('', '');
// }
if (resetCurrentDirId) {
onSelect && onSelect('', '');
}
function disposeData(data) {
setLoading(false);
......@@ -578,8 +577,6 @@ const AssetManageTree = (props) => {
const onTreeSelect = (keys, { node }) => {
if ((keys||[]).length === 0) {
setCurrentDirId();
onSelect?.('', '');
return;
}
......
......@@ -235,7 +235,7 @@ const AssetTable = (props) => {
}, [])
useEffect(() => {
if (nodeId !== null && nodeId !== undefined) {
if (nodeId) {
setSelectItem({});
setCheckedKeys([]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment