fix: directory tree
This commit is contained in:
@@ -69,6 +69,10 @@ export function ScriptExplorer({
|
||||
);
|
||||
|
||||
const byOwner = new Map<string, ScriptItem[]>();
|
||||
// 当前用户的目录树即使没有脚本也要渲染,所以预置空组。
|
||||
if (user?.user_id) {
|
||||
byOwner.set(user.user_id, []);
|
||||
}
|
||||
for (const item of visibleScripts) {
|
||||
const list = byOwner.get(item.owner_user_id) ?? [];
|
||||
list.push(item);
|
||||
@@ -201,7 +205,7 @@ export function ScriptExplorer({
|
||||
/>
|
||||
);
|
||||
})}
|
||||
{filteredScripts.length === 0 && (
|
||||
{filteredScripts.length === 0 && directories.length === 0 && (
|
||||
<div className="tree-empty">
|
||||
<span className="tree-empty__icon">
|
||||
<Icon name="script" size={24} />
|
||||
|
||||
Reference in New Issue
Block a user