@samitouri / QOSami-HFS / commits / 44dc4a3b

admin/fs: if tree is large, start with folders collapsed

Massimo Melina committed Oct 30, 2024 at 00:21 UTC 44dc4a3bb395f060541d3c8042ff6f97ce6208d9
1 file changed +1 -1
admin/src/VfsTree.ts
+1 -1
@@ -18,7 +18,7 @@ export const FileIcon = InsertDriveFileOutlined
18
19 export default function VfsTree({ id2node, statusApi }:{ id2node: Map<string, VfsNode>, statusApi: ApiObject }) {
20 const { vfs, selectedFiles } = useSnapState()
21 - const [expanded, setExpanded] = useState(Array.from(id2node.keys()))
21 + const [expanded, setExpanded] = useState(id2node.size < 20 ? Array.from(id2node.keys()) : ['/'])
22 const dragging = useRef<string>()
23 const ref = useRef<HTMLUListElement>()
24 if (!vfs)